dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: stop flv on last frame

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Posts
    114

    stop flv on last frame

    Hi,
    I need some assistance on my imported flv. I need to be able to stop the flv on its last frame rather than the flv playing through to the end and stopping at the beginning.

    cheers
    steph
    stephman

  2. #2
    Senior Member layerburn's Avatar
    Join Date
    Jul 2006
    Location
    USA
    Posts
    542
    If you are using the flv component, turn autorewind off in the parameters.
    This is your brain. This is your brain on script.

  3. #3
    Member
    Join Date
    Sep 2010
    Posts
    41
    Where do you find the autorewind in the parameters. I dont see it? Thanks

  4. #4
    Senior Member layerburn's Avatar
    Join Date
    Jul 2006
    Location
    USA
    Posts
    542
    First you must select the flv component on the stage, and then go to window>component inspector to view the parameters, that's where you will be able to change things like autoplay and autorewind.
    This is your brain. This is your brain on script.

  5. #5
    Member
    Join Date
    Sep 2010
    Posts
    41
    Thanks for the reply. I see autoplay but no autorewind. Is there a way to add it there that I'm not seeing?

  6. #6
    Senior Member
    Join Date
    Sep 2010
    Posts
    324
    Once you get switched over to NetStream, you'll never go back to the FLVPlayback component.
    Here's an example:
    Code:
    ns.onStatus = function(info) {
    		if(info.code == "NetStream.Play.Stop") {
    		trace("Video complete")
    // 		ns.seek(60);
    //		ns.play();
    		ns.pause();
    //		gotoAndPlay("after_video");
    //		getURL("http://www.cidigitalmedia.com/video.html", "_blank");
    		}
    	}
    At the end of video, traces message "Video complete"
    could seek to any point in the video, like 60 seconds into it, but commented out for now.
    Could play video again from that point (60 second) but commented out
    so instead pauses the video when complete (in the last frame)
    at that point, could interact with main timeline and jump to frame labled "after_video" but commented out for now
    Or could do a get URL and open a different Web page once the video finishes, but commented out for now
    But it shows just some of the options available with NetStream.
    Best wishes,
    Video Man

  7. #7
    Member
    Join Date
    Sep 2010
    Posts
    41
    Can you tell me how you would add code to go to a specific cue point in the video (navigation cue point)? I will be adding buttons to navigate to sections of the concert, so there will be mouse event added to the button. What would be the code for the function that says seek to "solo" section for instance?

  8. #8
    Senior Member
    Join Date
    Sep 2010
    Posts
    324
    Using cue points can sometimes be a real pain, so one simpler method is what's know as psuedo cue points.
    Just include in the button function a ns.seek to whatever time into the video you want, then pause or play the video from that point.
    Code:
    ns.seek(60);
    ns.play();
    seeks to 60 seconds and plays... very simple and it works..
    Don't have any navigation cue point code handy but here is an "event object"
    Code:
    ns.onCuePoint = function(evt:Object){
        trace(evt.name);
        trace(evt.time);
        if(evt.name == "play_vid1") { 
            trace("YO!Loading wide_holder!");
            wide_holder.loadMovie("rm/images/black_bear.swf");
        }
    
        if(evt.name == "play_vid2") { 
    		trace("YO!Loading standard_holder!");
            standard_holder.loadMovie("rm/images/sqis.swf");
        }
    };
    Once the event cue point "play_vid1" is reached, message is traced and a .swf is loaded into a holder elswhere on the stage as the video continues on
    Exact coding will very if you are using FLVPlayback component and not NetStream, there are some subtile differences.
    But however you end up using the navigation que points, the viewer will NOT be able to seek or navigate to that part of the video unless it has already been downloaded in the cache. If it's a very large file, that could be many seconds or even minutes later.
    So if a viewer comes to the main page, main video starts, then viewers click on "chapter 5" or whatever, chapters 1 - 4 must all download first before chapter 5 will be available.
    About the only way to overcome that is to stream the video instead of progressive download. Problem is, it's WAY more expensive.
    Best wishes,
    Video Man

  9. #9
    Member
    Join Date
    Apr 2009
    Posts
    45
    Play the video, and at the time you want the Cue Point, click “plus” icon, and select “Add Event” or “Navigation” to your video to interact with another element on a web page. You may, for example, want to display text, synchronize with a Flash animation, seek a different point in time in the video, or switch to a different video file together. Following is the detailed guide if you want to learn more:http://www.flash-video-soft.com/blog/?p=199

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