Results 1 to 5 of 5

Thread: AS3 load the path to FLV at runtime

  1. #1
    Join Date
    Aug 2008
    Location
    Estados Unidos
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default AS3 load the path to FLV at runtime

    I have a custom skin that I created that will play properly from this html:

    HTML Code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>video player</title>
    <script language="javascript">AC_FL_RunContent = 0;</script>
    <script src="AC_RunActiveContent.js" language="javascript"></script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!-- saved from url=(0013)about:internet -->
    <script language="javascript">
    	if (AC_FL_RunContent == 0) {
    		alert("This page requires AC_RunActiveContent.js.");
    	} else {
    		AC_FL_RunContent(
    			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
    			'width', '320',
    			'height', '240',
    			'src', 'video player',
    			'quality', 'high',
    			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
    			'align', 'middle',
    			'play', 'true',
    			'loop', 'true',
    			'scale', 'showall',
    			'wmode', 'window',
    			'devicefont', 'false',
    			'id', 'video player',
    			'bgcolor', '#ffffff',
    			'name', 'video player',
    			'menu', 'true',
    			'allowFullScreen', 'true',
    			'allowScriptAccess','sameDomain',
    			'movie', 'video player',
    			'salign', ''
    			); //end AC code
    	}
    </script>
    <noscript>
    	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="320" height="240" id="video player" align="middle">
    	<param name="allowScriptAccess" value="sameDomain" />
    	<param name="allowFullScreen" value="true" />
    	<param name="movie" value="video player.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="video player.swf" quality="high" bgcolor="#ffffff" width="320" height="240" name="video player" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    	</object>
    </noscript>
    </body>
    </html>
    What I'd like to do is change the FLVplayback's source or content path at runtime from a <param> or FlashVars or whatever that's located in the html. I've tried using the DW4 interface to add a video with my skin but it seems to have problems connecting to FMS3. Ideally I would like to stream the content but if forced to use progressive download I will.

    Thank you for any incite you may have,
    Joe

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    I'm not sure what exactly your question is. Can you please rephrase?

    On a related note, Lee Brimelow has some great video tutorials on video players at gotoAndLearn(). There are eight tutorials at the very bottom of the page related to building a video player. That might be of use to you.

    There are also tutorials on dynamic loading of videos via XML, and FlashVars.

  3. #3
    Join Date
    Aug 2008
    Location
    Estados Unidos
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default

    I've seen Lee's stuff and he's pretty cool. A lot of the content is for AS2 though.

    As for the rephrased question. I want to change the FLV that's played when the movie loads. I've seen tuts on populating a playlist from an XML file, but that's not what I need to do. So let me better explain exactly what I'm doing.

    One page will have a list of video links. All of these video will reside on my streaming server. The href for the videos will be generated by php with their videoID.

    HTML Code:
    <a href="videoplayer.php?videoID=00001">Video one</a>
    <a href="videoplayer.php?videoID=00002">Video two</a>
    Now on the videoplayer.php file, php will access the mySQL DB and get the path to the video file. i.e. rtmp://localhost/vod/myfirstvideo.flv

    How can I now pass that data to the FLVplayback component in my .swf that's on this videoplayer.php page?

    In flash if you look at the parameters of an FLVplayback component there's a field for "source". I want to change this field at runtime with the aforementioned data from the php query.

    Thanks

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Ah, I see.

    You should be able to combine the teachings of this tutorial and this video to come up with what you need.

    Post back if you have any troubles.

  5. The Following User Says Thank You to Medyman For This Useful Post:

    jeaux (10-02-2008)

  6. #5
    Join Date
    Aug 2008
    Location
    Estados Unidos
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default Super cool

    All I was missing was the

    Code:
    if(root.loaderInfo.parameters["VideoPath"] !=null)
    I kept trying to publish but it wouldn't compile without the if(!= null)

    I was able to implement the change without creating a FLVPlaybackpro class like the one tutorial link you provided like this.

    Code:
    myFLV.source = root.loaderInfo.parameters["VideoPath"];
    Anyway the link to that swfobject_generator helped immensely.

    I posted a similar post to actionscript.org and have yet to receive a reply. After your direction to the proper tuts to solve this problem and realizing how easy the solution was I am rather surprised at the lack of responses. I suppose maybe my description of my problem was worded oddly or something.

    Many thanks for your time,
    Joe

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •