Help - Search - Members - Calendar
Full Version: Embedding a flash video player
HTMLHelp Forums > Web Authoring > Graphics, Flash and Multimedia
DeaPeaJay
I'm trying to get a video to embed on a page that I created. The files were created with Dreamweaver. Embedding a simple .swf doesn't seem to be a problem. But the way dreamweaver set the video up was to use an "FLVPlayer_Progressive.swf" file with a skin and video stream.

It works on this page: http://sandbox.exit42design.com/flash/index.html

However, when I try to put the same code on a page in a different directory I get an error that it can't find the .flv file I'm using, but for some reason it's looking in the wrong directory.

http://sandbox.exit42design.com/flash/some...tory/index.html

In the code below, the path is set to go a level down to find the file, but it doesn't look there, and then complains that it can't find it. I don't understand what I'm doing wrong.

CODE
<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=../Clear_Skin_1&streamName=../support_01&autoPlay=true&autoRewind=false" />
pandy
Don't see anything that looks like the URL to a file there and ../ means up, not down. But hey, I don't know nothin about flash! biggrin.gif
DeaPeaJay
QUOTE(pandy @ May 15 2008, 12:15 AM) *

Don't see anything that looks like the URL to a file there and ../ means up, not down. But hey, I don't know nothin about flash! biggrin.gif


Yeah, you and me both wacko.gif

And yeah, I meant up.

the path to the file is within the flashVars variable there, for some reason the extension was removed. (Dreamweaver generated it originally, go figure).

Here's all the code, it just needs to be modified to reference files in an alternate directory rather than the same directory.
CODE

<object id="myId2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="384" height="288">
    <param name="movie" value="FLVPlayer_Progressive.swf" />
    <param name="salign" value="lt" />
    <param name="quality" value="high" />
    <param name="scale" value="noscale" />
    
    <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=support_01&autoPlay=true&autoRewind=false" />
        <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="FLVPlayer_Progressive.swf" width="384" height="288">
        <!--<![endif]-->
        <div>
            <h1>Alternative content</h1>
            <p><a href="http://www.adobe.com/go/getflashplayer">
            <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
        </div>
        <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
</object>



Here was my attempt to modify it to work in an alternate directory,

CODE

            <object id="myId2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="384" height="288">
                <param name="movie" value="../FLVPlayer_Progressive.swf" />
                <param name="salign" value="lt" />
                <param name="quality" value="high" />
                <param name="scale" value="noscale" />
                <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=../Clear_Skin_1&streamName=../support_01&autoPlay=true&autoRewind=false" />
                <!--[if !IE]>-->
                <object type="application/x-shockwave-flash" data="../FLVPlayer_Progressive.swf" width="384" height="288">
                <!--<![endif]-->
                <div>
                    <h1>Alternative content</h1>
                    <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
                </div>
                <!--[if !IE]>-->
                </object>
                <!--<![endif]-->
            </object>



Wait a minute, I may have just figured it out. I think it may load in the FLVPlayer_Progressive.swf, and then any path in FlashVars should be set relative to the location of that .swf file.

Sure enough, I changed the code to this and it works

CODE
<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=../Clear_Skin_1&streamName=support_01&autoPlay=true&autoRewind=false" />


But the path to Clear_Skin_1.swf is still looking one directory up, but if I remove that, it stops working again. So why would the streamName path be different from the skinName path when the files are in the same directory! This doesn't make any sense.
DeaPeaJay
I spoke too soon, because this isn't working in Firefox at all, haven't even tried the other browsers yet. *sigh* Who knew embedding a video player would be this hard.
pandy
QUOTE(DeaPeaJay @ May 15 2008, 03:35 PM) *


the path to the file is within the flashVars variable there


OK, but exactly what part of that corresponds to the URL? Is it this? huh.gif
QUOTE
streamName=../support_01

pandy
Sorry, I didn't see that you had already solved this problem (and that answered my question too).

Well, learn that DW is partly crap. biggrin.gif

Couldn't you get one of those free flash movie players that are available on the Web?
DeaPeaJay
What free flash movie players? out of curiosity.

I ended up scrapping all that junk code and went with this instead. http://www.swffix.org/swfobject/generator/

Works like a charm, I've got it setup to use javascript to generate the markup, odds are if they don't have javascript, they don't have flash either. And the alternate content for if they *don't* have either will present them with links to mov or wmv files. So I can view it on my iPhone too =)

I love accessibility
pandy
I don't know, but there are lots of them. Google. Here's one.
http://www.flowplayer.org/
DeaPeaJay
QUOTE(pandy @ May 15 2008, 02:29 PM) *

I don't know, but there are lots of them. Google. Here's one.
http://www.flowplayer.org/



I saw that one in the midst of my googling, it's ok, but the playback controls aren't very good compared to what I'm using now, *AND* it's not free without their label stuck on there.

I'm amazed that the video playback controls built into Dreamweaver work as well as they do, most flash player controls I see on the web suck, but the plain vanilla ones that ship with Dreamweaver are fantastic. Go figure. (Even youtube's suck)
3dfan
As for me something wrong with this link, there is no definite point at the file maybe that's why error appears in different directory, I am not a professional but wish you good luck in search!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.