A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Why won't video stream off a CD-ROM?

  1. #1
    Member
    Join Date
    Sep 2003
    Location
    Long Island, NY
    Posts
    33

    Why won't video stream off a CD-ROM?

    I'm just wondering why video files do not stream from a CD projector file.

    Using Flash MX Pro, I created a projector file with one keyframe and an empty MovieClip into which an external .swf loads. In the .swf file which has loaded and is playing, on a specified keyframe, a button action calls yet another .swf file (containing the video) to load and play in yet another empty MovieClip.

    No matter what I do, the video .swf file will not play until the entire .swf file is transferred from the CD into the MovieClip. The odd thing is that EVERY item in my Flash presentation is on the CD to begin with.

    It seems like everything has to load into the RAM memory of the host computer before it plays. Is this just they way it is?

    Since the video file is 7 Megabytes, the Flash projector "locks-up" or "freezes" until the entire 7 megs are loaded into the projector file. I thought for sure using loadmovie would prevent this from happening, but it doesn't. The swf file will not stream into the projector file.

    Does anyone know of a way to prevent projector file "lock-up" when large video files are loading? The delay time is about 8 seconds or so before the video starts to play. When the projector file "locks-up" or freezes, it won't even play a "loading video" animation.

    Remember: this is for a self-contained CD-ROM.

    Thanks for any feedback or comments that might help to overcome this annoying problem. I doubt I'm the only one here that has noticed this problem loading video files on CD-ROM projectors.


    nycomet@optonline.net
    nycomet

  2. #2
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    if you are using MX 2004 Pro then you can save your video as an FLV and load it as an external file at run-time.

    I am using the Flash MX 2004 Pro video controls to load a 105Mb video that is stored on the CD as an FLV. and the playback starts almost instantly on even my older machines. (I created the FLV using Sorenson Squeeze but I think you can use Flash to create it as well.)

    Let me know if you need an example or further assistance in how to make this work.

  3. #3
    Member
    Join Date
    Sep 2003
    Location
    Long Island, NY
    Posts
    33

    105 meg video - no delay? WOW!

    Hello. Thank you for your response to my question about video on CD-ROMs.

    I am using Sorenson Squeeze for Flash and I generated .flv files of the videos I put on my CD-ROM project. In Flash MX Pro I created my presentation file and made a Projector file.

    What I did for the video files is import the .flv file into a new Flash file. I added some effects, then output a new .swf file (containing the video, audio etc).

    A Button in the main Projector file calls the .swf to load into an empty MovieClip. When this action is evoked, this is where the "hang" or "delay" occurs as the .swf containing the video gets loaded into the Projector file.

    Please give me some guidnace or an example of how you are able to play a 105 megabyte Flash .flv file in a Projector on a CD-ROM with little or no delay. I am very interested at how you set this up. Do you know if your .flv file is actually "streaming" while it loas into the projector -- or is it playing independently as a linked external file?

    I would love to be able to provide video playback on my CD-ROM projects with no "hang" or "delay" as the video loads.

    Thank you for your help.

    nycomet@optonline.net
    Bay Shore, NY
    nycomet

  4. #4
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    well, my FLV was created with Squeeze. it is stored on the CD. and I set up my Flash application to use the new video components to do the playing. and, it starts almost imstantly!

    however, it sounds like you are embedding your FLV, adding effects in Flash and then exporting as an SWF. since an externally loaded SWF must be in memory before it starts playing you will continue to suffer the "hang" if you must do it this way.

    basically, you need to get everything in the FLV. now I know how to do this using a video editor but it sounds like you are using Flash to add things (like titling, graphics, etc.?). I am not aware of any way to export an FLV from Flash that will also contain all the other layers like it would when you export as SWF. that doesn't mean it's not possible but I'm not aware of how this could be done.

    so as I see it you have three options,

    1) forget the additional stuff you are adding in Flash and load the FLV directly from the disk

    2) find a way to get the additional stuff embedded in the FLV (either in your video editing program before creating the FLV or maybe there is a way to convert an SWF to an FLV?)

    3) keep your additional stuff in your main application and just load the FLV to play under it. this might be hard to get synchronized properly though.

  5. #5
    Member
    Join Date
    Sep 2003
    Location
    Long Island, NY
    Posts
    33

    How do I control the external video file

    Hello again,

    I looked into the Flash help documentation and I found out how to set-up a streaming link to an external video file. This is good stuff, but now I have a new dilemma: how do I control the external video file?

    Here's the actionscript I found to create the link to an external video file. Is this what you used? If so, how do you control the video (play, pause, stop rewind etc.)


    // Create a NetConnection object
    var netConn:NetConnection = new NetConnection();
    // Create a local streaming connection
    netConn.connect(null);
    // Create a NetStream object and define an onStatus() function
    var netStream:NetStream = new NetStream(netConn);
    netStream.onStatus = function(infoObject) {
    status_txt.text += "Status (NetStream)" + newline;
    status_txt.text += "Level: "+infoObject.level + newline;
    status_txt.text += "Code: "+infoObject.code + newline;
    };
    // Attach the NetStream video feed to the Video object
    my_video.attachVideo(netStream);
    // Set the buffer time
    netStream.setBufferTime(5);
    // Begin playing the FLV file
    netStream.play("myvideo.flv");


    Thank again for your added guidance and suggestions.

    nycomet@optonline.net
    nycomet

  6. #6
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    Basically I used the media components and linked them up as shown below. So I didn't need to use the AS you show. I'm not sure if one way is better than the other. In my case, the built-in components and functionality just happened to provide me with exactly what I needed.

    However, I was originally planning to put the entire video on the CD and then use cuepoints to allow users to jump to the various chapters. But I had a lot of trouble with cuepoints not jumping to the exact place I wanted them to. I suspect this has something to do with where keyframes are located in the video but I never really confirmed what the issue was since I found another way to resolve my problem. Basically, I cut my video into chapters and placed both the full-length original and all of the chapters on the CD. Then the user can select what they wish to view by clicking the appropriate button. At some point I'll go back and see how to make cuepoints work since the approach I used took a little extra time to prepare the separate chapter videos and also because it required a lot more space on the CD (something that didn't matter on this project but could be important in the future).


    1) I put a MediaDisplay component and a MediaController on the stage and named them,

    myDisplay480
    myController480

    2) Then I applied a behavior to link them (below is the code).

    Code:
    //on load for myDisplay480
    on (load) {
    
    	// AssociateController Behavior
    	this.associateController(this._parent.myController480);
    	// End AssociateController Behavior
    			
    }
    3) Then I put code on several buttons to assign the proper FLV to the MediaDisplay component on demand as shown below,

    Code:
    //on a button
    on(release){
    	if(myDisplay480.playing == false){
    		myDisplay480.play();
    	}
    	myDisplay480.setMedia("complete480.flv","FLV");
    }
    Last edited by XcVbSdRw; 10-24-2004 at 10:41 PM.

  7. #7
    Junior Member
    Join Date
    Nov 2004
    Posts
    8
    Hi,

    I have exactly the same problem.
    I use flash MX .
    is it possible to play external flv files like you describe
    in flash MX or do you need flashMX Pro?
    Cheers

  8. #8
    Member
    Join Date
    Oct 2004
    Posts
    67
    To use the MediaDisplay component to stream flv files, you need Flash MX Pro 2004. I don't think any other version have it. But beware, it's buggy. It does the basics well, but after that it gets messy.

    Tom

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center