A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Streaming .flv cue point problem

Hybrid View

  1. #1
    Junior Member
    Join Date
    Aug 2006
    Posts
    12

    Streaming .flv cue point problem

    I’ve been working with Flash video with synced slide presentations since February, which have been exclusively download streaming, all based on the presentation available at the adobe web site:

    http://www.adobe.com/devnet/flash/ar...corppreso.html

    My issue has come up when using this template with streaming flv’s, the buttons that I use to reference the cue points in the video and slides on the timeline do not work reliably; sometimes they will shuttle the video and slides to the correct point, usually they move the slides on timeline to the appropriate spot and the video jumps back to the beginning. Besides this sizable problem, the presentation plays the way it is supposed to. Is there a setting in the component inspector that I’m missing? Should I re-encode the video with Navigation cue points? Any help would be appreciated.
    L

  2. #2
    Junior Member
    Join Date
    Aug 2006
    Posts
    12

    Problem Solved

    Finally got the solution from adobe, The change must be made in the ActionScript code that calls the slides and the buttons, I have written up these changes and posted them so nobody has to go through same ordeal I did to make something work the way adobe says it is supposed to.

    Symptom: When a Streaming Video is put into the synced-slide template used to deliver download streaming or CD-Rom based projects, the project will play with the slides in-sync, but when you try to use the buttons or the video skin to advance or retard the slides, the presentation jumps back to the beginning.

    The Solution: The problem, as it turns out, is in the code that calls the buttons and the slides that resides on the timeline in the Layer called Actions & Lables on the frame that is labeled “slide1” under the “Actions” tab at the bottom (or the ActionScript)– at the beginning of video / synced-slide portion of the template. The problem lies in the placement of five lines of code that are moved up, those lines of code are as follows:

    {
    // If the video is currently stopped, then play it
    if(!display.playing ){
    display.play();
    }

    In the original code used for the Download Streaming / CD Rom, this portion was lower in the code, beneath the beginning section that looks like this:

    // Is this a screens document or not?
    var uses_screens:Boolean = false;
    stop();

    // *************************
    // Navigation buttons call this function to trigger a change
    // in the video and the view of the content
    function seekToCuePoint( cueName ) : Void
    {
    // Find the cue point in the FLVPlayback component, seek
    // to time, and highlight the next button for a quick redraw
    var c = display.findCuePoint( cueName );
    display.seekSeconds( c.time );
    findNextButton( c.name );
    }

    // *************************
    // The natural flow through the video or jumping by seeking
    // forward and backward will trigger the following function
    function synchVideoToInterace( cueName:String ):Void
    {
    // If the video is currently stopped, then play it
    if(!display.playing ){
    display.play();
    }

    If you wanted to manually change this code with-in a pre-existing Download Streaming / CD Rom presentation, simply cut the code out of it’s location, and paste it higher in the code, beneath the section that follows that you will recognize from the previous section:

    // Is this a screens document or not?
    var uses_screens:Boolean = false;
    stop();

    // *************************
    // Navigation buttons call this function to trigger a change
    // in the video and the view of the content
    function seekToCuePoint( cueName ) : Void

    If all of that is too confusing, I have copied the two codes in there intirety onto the next four pages of this document, labeled to show which is used for streaming and which is used for Download Streaming / CD Rom presentations, simply copy and paste from this document into the code area specified above, and you should be good to deliver any way that is possible.


    For Download Streaming / CD Rom presentations:

    // Is this a screens document or not?
    var uses_screens:Boolean = false;
    stop();

    // *************************
    // Navigation buttons call this function to trigger a change
    // in the video and the view of the content
    function seekToCuePoint( cueName ) : Void
    {
    // Find the cue point in the FLVPlayback component, seek
    // to time, and highlight the next button for a quick redraw
    var c = display.findCuePoint( cueName );
    display.seekSeconds( c.time );
    findNextButton( c.name );
    }

    // *************************
    // The natural flow through the video or jumping by seeking
    // forward and backward will trigger the following function
    function synchVideoToInterace( cueName:String ):Void
    {
    // If the video is currently stopped, then play it
    if(!display.playing ){
    display.play();
    }
    // Show associated content on screens or labeled frames
    if( uses_screens ){
    currentSlide.gotoSlide(this[ cueName ]);
    }else{
    gotoAndStop( cueName );
    }
    // Update the higlight position
    findNextButton( cueName );
    }

    // Layout the button highlight when requested
    function findNextButton( cueName:String ):Void
    {
    // Look for buttons named with the current cue point
    // name plus the letters '_btn' (i.e. studiomx_btn)
    var cueBtn = this[ cueName+"_btn" ];
    if( cueBtn != undefined )
    {
    // Attach the highlight clip if needed
    if( highlight_mc == undefined ){
    this.attachMovie("ThumbOutlineSelected","highlight _mc", 100);
    }
    highlight_mc._x = cueBtn._x;
    highlight_mc._y = cueBtn._y;
    }
    }

    // *************************
    // Create a listener object to catch events from
    // the video component and update the interface...
    var videoEventHandler:Object = new Object();
    videoEventHandler.cuePoint = function( evt:Object ):Void
    {
    // Get the cue name from the event object
    synchVideoToInterace( evt.info.name );
    }
    videoEventHandler.fastForward =
    videoEventHandler.rewind = function( evt:Object ):Void
    {
    // Get the cue name of the nearest cue point
    var nearestCue = evt.target.findNearestCuePoint(evt.playheadTime);
    synchVideoToInterace( nearestCue.name );
    }
    display.addEventListener("cuePoint",videoEventHand ler);
    display.addEventListener("fastForward",videoEventH andler);
    display.addEventListener("rewind",videoEventHandle r);



    For Streaming Video presentations:

    // Is this a screens document or not?
    var uses_screens:Boolean = false;
    stop();

    // *************************
    // Navigation buttons call this function to trigger a change
    // in the video and the view of the content
    function seekToCuePoint( cueName ) : Void
    {

    // If the video is currently stopped, then play it
    if(!display.playing ){
    display.play();
    }

    // Find the cue point in the FLVPlayback component, seek
    // to time, and highlight the next button for a quick redraw
    var c = display.findCuePoint( cueName );
    display.seekSeconds( c.time );
    findNextButton( c.name );
    }

    // *************************
    // The natural flow through the video or jumping by seeking
    // forward and backward will trigger the following function
    function synchVideoToInterace( cueName:String ):Void
    {
    // Show associated content on screens or labeled frames
    if( uses_screens ){
    currentSlide.gotoSlide(this[ cueName ]);
    }else{
    gotoAndStop( cueName );
    }
    // Update the higlight position
    findNextButton( cueName );
    }

    // Layout the button highlight when requested
    function findNextButton( cueName:String ):Void
    {
    // Look for buttons named with the current cue point
    // name plus the letters '_btn' (i.e. studiomx_btn)
    var cueBtn = this[ cueName+"_btn" ];
    if( cueBtn != undefined )
    {
    // Attach the highlight clip if needed
    if( highlight_mc == undefined ){
    this.attachMovie("ThumbOutlineSelected","highlight _mc", 100);
    }
    highlight_mc._x = cueBtn._x;
    highlight_mc._y = cueBtn._y;
    }
    }

    // *************************
    // Create a listener object to catch events from
    // the video component and update the interface...
    var videoEventHandler:Object = new Object();
    videoEventHandler.cuePoint = function( evt:Object ):Void
    {
    // Get the cue name from the event object
    synchVideoToInterace( evt.info.name );
    }
    videoEventHandler.fastForward =
    videoEventHandler.rewind = function( evt:Object ):Void
    {
    // Get the cue name of the nearest cue point
    var nearestCue = evt.target.findNearestCuePoint(evt.playheadTime);
    synchVideoToInterace( nearestCue.name );
    }
    display.addEventListener("cuePoint",videoEventHand ler);
    display.addEventListener("fastForward",videoEventH andler);
    display.addEventListener("rewind",videoEventHandle r);

  3. #3
    Senior Member
    Join Date
    Jan 2006
    Posts
    106

    cuepoints

    This is an Awesome link!! thanks,

    I have been starting out with that template and changed the button selections to a listbox, like chapters, with no luck. I can't get the listbox to control things instead of buttons. I will review your comments and see if I can tweak the code for listbox items instead of buttons.

    Thanks

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