Skip to main content
Participating Frequently
December 9, 2009
Question

seekBar breaks everything when seeking beyond the buffer

  • December 9, 2009
  • 1 reply
  • 310 views

I used a template from adobe and modified it to fit my needs. Instead of one long video with cuepoints, I have several videos that I want to switch when the buttons are clicked. Everything works great except when the user seeks beyond the buffer (progressive download). When this happens, everything breaks. All of the buttons, playback, play/pause... everything. You have to refresh the page and start over.

My quesiton is, does the seekBar need a custom eventHandler? Shouldn't it work on it's own? Here is my code:

import flash.events.*;
import fl.video.*;

//-----------------
// Video control assignment
//-----------------

display.playPauseButton = play_btn;
display.stopButton = stop_btn;
display.seekBar = seek_bar;
display.volumeBar = volume_bar;
display.muteButton = mute_btn;

//-------------------------
// Navigation / screen state
//-------------------------

// Store the current button name
var currentBtn:*;
var currentBtnName:String = "";

function navigate( cueName:String, seekTo:Boolean ):void
{

    display.stop();
    var filename = "flvs/"+cueName+".flv";
    display.source = filename;
    display.play();
}

//-------------------------
// Button event handling
//-------------------------

// Button 1 / Video 1
function introductionHandler( event:MouseEvent ):void
{
    navigate("introduction", true);
}
introduction_btn.addEventListener(MouseEvent.CLICK, introductionHandler);

// Button 2 / Video 2
function question3_4_Handler( event:MouseEvent ):void
{
    navigate("question3_4", true);
}
question3_4_btn.addEventListener(MouseEvent.CLICK, question3_4_Handler);

// Button 3 / Video 3
function question5_7_Handler( event:MouseEvent ):void
{
    navigate("question5_7", true);
}

This topic has been closed for replies.

1 reply

jpl80Author
Participating Frequently
December 11, 2009

I've checked to see if the flv in question was encoded with the proper metadata and it is. I did a stacktrace and it outputs the time of the video. So I guess we can safely eliminate that...