Forum: Ruby on Rails Flash Skin and Rails View Issue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Nicholas Van W. (Guest)
on 2007-04-25 20:02
(Received via mailing list)
Hi,

I have an issue embedding a flash movie into one of my rails views.

/movies/index.rhtml
     embeds /resources/movies/episode1.swf and episode1.flv

e.g index.rhtml includes:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
http://fpdownload.macromedia.com/pub/shockwave/cab...
width="320" height="280" id="episode1" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value=/resources/movies/episode1.swf" /><param
name="quality" value="high" /><param name="bgcolor" value="#ffffff"
/><embed
src="/resources/movies/episode1.swf" quality="high" bgcolor="#ffffff"
width="320" height="280" name="episode1" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

If I put this in index.html in /resources/movies, everything works fine.

But as I understand it, flash.swf references a player skin in the same
directory (/resources/movie)- MojaveExternalAll.swf.

With the code in my view, this isn't being found, so my movie plays
without
controls.

Adobe's site says "FLVPlayback skin SWF must be in same directory as
HTML
file"
http://www.adobe.com/cfusion/knowledgebase/index.c...

If I load an html file from /resources/movie it all works fine. However,
I
need to embedd that flash movie into my Rails view.

Hopefully I've made myself clear. I expect this may be a common problem
with
loading components that load other components in their same directory. I
tried using javascript to modify base href, but to no avail.

Any thoughts?

Thanks,
Nick
John I. (Guest)
on 2007-04-25 20:23
(Received via mailing list)
making sure I have this straight.
your flash.swf, episode1.flv and MojaveExternalAll.swf are in the same
directory (/resources/movie)
and when you have a web page in that directory that flash movie works
fine.
but when you access that slash movie from another directory it fails?

I think it might be a relative link to the
MojaveExternalAll.swf.(which is the controller for the movie,
correct?)
(the movie.swf (just a shell) loads the FLV and the MojaveExternalAll)

let's do some testing.
we know it works in the same directory.
lets make a new in the /resources/movie called flash and move all you
flash movie things into that directory.
now with the web page in the /resources/movie/ directory see if you
can get the flash movie to play from the /resources/movie/flash
directory.

I think that will work. But if you start moving the flash components
around into different directories it fails.

It's been several months since I've done flash video work. I running
from memory.

let me know if that helps.
John
Nicholas Van W. (Guest)
on 2007-04-26 01:19
(Received via mailing list)
Thanks for the thoughts.

Everything works when in the same directory as a regular html page.

I got it to work in a rails view by doing the following:
1. move the flash files to public (e.g. / )
2. add <base href="www.mysite.com" /> to my main layout.
3. reference flash file by "movie.swf" reference in view.

Not sure exactly why yet, but I'm happy for now.

Thanks,
Nick

On 4/25/07, John I. <removed_email_address@domain.invalid> wrote:
> MojaveExternalAll.swf.(which is the controller for the movie,
>
> > Hi,
> >
> > align="middle" allowScriptAccess="sameDomain"
> without
> >
> >
> >
> >  >
> >
>
> >
>


--
Nicholas Van W.
This topic is locked and can not be replied to.