# Can't get SWF player to display in webpage

**URL:** <https://www.ruby-forum.com/t/cant-get-swf-player-to-display-in-webpage/165876>\
**Category:** Rails\
**Created:** [April 18, 2009, 8:14pm UTC](https://www.ruby-forum.com/t/cant-get-swf-player-to-display-in-webpage/165876 "2009-04-18T20:14:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@rubio](https://www.ruby-forum.com/u/rubio)\
**Post date:** [April 18, 2009, 8:14pm UTC](https://www.ruby-forum.com/t/cant-get-swf-player-to-display-in-webpage/165876/1 "2009-04-18T20:14:35Z")

</div>

Found a great link  
([Eleventyten.com is for sale | HugeDomains](http://blog.eleventyten.com/2007/6/8/embedding-swf-content-with-ror/))  
describing adding Flash content (in this case playerMultipleList.swf) in  
a “rails” webpage.

I’ve followed the instructions to a “T”, however the player doesn’t  
display on the page … just the words playerMultipleList.swf appear ☹

Everything else is working great after retrofitting the pages to the ROR  
framework, but this is one of the most important features. If you have  
experience with this and would kindly share it, I will greatly  
appreciate it!

Please see attachment for the code I’m using !

Thanks Rubio

---

<div class="post-metadata">

**Author:** ![rubio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@rubio](https://www.ruby-forum.com/u/rubio)\
**Post date:** [April 18, 2009, 8:52pm UTC](https://www.ruby-forum.com/t/cant-get-swf-player-to-display-in-webpage/165876/2 "2009-04-18T20:52:23Z")

</div>

On Apr 18, 7:14 pm, Rubio R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> experience with this and would kindly share it, I will greatly  
> appreciate it!

The path to playerMultipleList.swf looks suspicious to me - if it is  
at RAILS\_ROOT/public/swf/playerMultipleList.swf then the path to it  
(from the browser’s point of view) is just /swf/playerMultipleList.swf  
(since the document root should be RAILS\_ROOT/public)

Fred

---

<div class="post-metadata">

**Author:** ![rubio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@rubio](https://www.ruby-forum.com/u/rubio)\
**Post date:** [April 18, 2009, 11:06pm UTC](https://www.ruby-forum.com/t/cant-get-swf-player-to-display-in-webpage/165876/3 "2009-04-18T23:06:29Z")

</div>

Frederick C. wrote:

> On Apr 18, 7:14ï¿½pm, Rubio R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > experience with this and would kindly share it, I will greatly  
> > appreciate it!
> 
> The path to playerMultipleList.swf looks suspicious to me - if it is  
> at RAILS\_ROOT/public/swf/playerMultipleList.swf then the path to it  
> (from the browser’s point of view) is just /swf/playerMultipleList.swf  
> (since the document root should be RAILS\_ROOT/public)
> 
> Fred

Fred Thanks for the quick reply. I initially had the path as  
/swf/playerMultipleList.swf as you suggest, but it didn’t grab the  
player in that case either (and I’ve checked and made sure that the  
player is in RAILS\_ROOT/public/swf. But, theoretically you’re  
absolutely right. I’ll keep digging; it’s prob just some little  
something I’m not seeing!

Thanks, again  
R

---

<div class="post-metadata">

**Author:** ![rubio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@rubio](https://www.ruby-forum.com/u/rubio)\
**Post date:** [April 21, 2009, 3:42pm UTC](https://www.ruby-forum.com/t/cant-get-swf-player-to-display-in-webpage/165876/4 "2009-04-21T15:42:22Z")

</div>

Not sure, but some Flash players require not the path, but an absolute  
URL, so instead of having:  
…/…/…/public/swf/playerMultipleList.swf

you should generate something like:  
[http://www.theapp.com/swf/playerMultipleList.swf](http://www.theapp.com/swf/playerMultipleList.swf)

And also there should be no ‘public’ in the URL.

Dmitry

---

<div class="post-metadata">

**Author:** ![rubio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@rubio](https://www.ruby-forum.com/u/rubio)\
**Post date:** [April 21, 2009, 9:30pm UTC](https://www.ruby-forum.com/t/cant-get-swf-player-to-display-in-webpage/165876/5 "2009-04-21T21:30:32Z")

</div>

Dmitry S. wrote:

> Not sure, but some Flash players require not the path, but an absolute  
> URL, so instead of having:  
> …/…/…/public/swf/playerMultipleList.swf
> 
> you should generate something like:  
> [http://www.theapp.com/swf/playerMultipleList.swf](http://www.theapp.com/swf/playerMultipleList.swf)
> 
> And also there should be no ‘public’ in the URL.
> 
> Dmitry

Dmitry - please see the attachment!

It’s working now, but with the path specified simply as  
/swf/playerMultipleList.swf. Problem seemed to be an incorrect  
swfobject.js. As soon as I copied the original from the download to the  
#{RAILS\_ROOT}/public/javascripts folder, the player appeared however,  
unfortunately there’s still a problem … the tracks don’t appear (get  
undefined where a track should be) even though I used the same pathing  
convention to point to public/Sounds (should evaluate to  
#{RAILS\_ROOT}/public/Sounds just as the swf path evaluated to  
#{RAILS\_ROOT}/public/swf and found the player.

At first I thought this problem would be a piece of cake, but now after  
trying the same convention I just mentioned, as well as the relative  
path, and absolute path to the myPlayList.xml still just “undefined” for  
the track … please see the attachment for a screen shot of this. and  
the current code as well.

If you have any ideas, it’s greatly appreciated.

Thanks for your time

---

<div class="post-metadata">

**Author:** ![rubio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@rubio](https://www.ruby-forum.com/u/rubio)\
**Post date:** [April 21, 2009, 10:32pm UTC](https://www.ruby-forum.com/t/cant-get-swf-player-to-display-in-webpage/165876/6 "2009-04-21T22:32:56Z")

</div>

Hi Rubio,

Yep, as I remember eiter Flash object, either content should be a  
path, and another one should be a URL. So, if the Flash player  
requires just a path (/swf/playerMultipleList.swf), then I think that  
the content should be provided as a full URL ([http://www.theapp.com/](http://www.theapp.com/)  
Sounds/song.mp3)

Dmitry

On Apr 21, 11:30 pm, Rubio R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![rubio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@rubio](https://www.ruby-forum.com/u/rubio)\
**Post date:** [August 5, 2010, 9:08pm UTC](https://www.ruby-forum.com/t/cant-get-swf-player-to-display-in-webpage/165876/7 "2010-08-05T21:08:06Z")

</div>

Rubio R. wrote:

> Dmitry S. wrote:
> 
> > Not sure, but some Flash players require not the path, but an absolute  
> > URL, so instead of having:  
> > …/…/…/public/swf/playerMultipleList.swf
> > 
> > you should generate something like:  
> > [http://www.theapp.com/swf/playerMultipleList.swf](http://www.theapp.com/swf/playerMultipleList.swf)
> > 
> > And also there should be no ‘public’ in the URL.
> > 
> > Dmitry
> 
> Dmitry - please see the attachment!
> 
> It’s working now, but with the path specified simply as  
> /swf/playerMultipleList.swf. Problem seemed to be an incorrect  
> swfobject.js. As soon as I copied the original from the download to the  
> #{RAILS\_ROOT}/public/javascripts folder, the player appeared however,  
> unfortunately there’s still a problem … the tracks don’t appear (get  
> undefined where a track should be) even though I used the same pathing  
> convention to point to public/Sounds (should evaluate to  
> #{RAILS\_ROOT}/public/Sounds just as the swf path evaluated to  
> #{RAILS\_ROOT}/public/swf and found the player.
> 
> At first I thought this problem would be a piece of cake, but now after  
> trying the same convention I just mentioned, as well as the relative  
> path, and absolute path to the myPlayList.xml still just “undefined” for  
> the track … please see the attachment for a screen shot of this. and  
> the current code as well.
> 
> If you have any ideas, it’s greatly appreciated.
> 
> Thanks for your time

Rubio,

I’m having this same problem. I tried relative paths and then an  
absolute path [http://localhost:3000/public/music/playlist.xml](http://localhost:3000/public/music/playlist.xml) and could  
not get it to work. How did you solve this?

Thanks,  
Kelly
