PDA

View Full Version : flvplayback component not progressively downloading



davidc
July 6th, 2009, 09:49 AM
This has me flummoxed. Please help.

My video files are not playing progressively off the host server. They do in simulate download:

Here's the code for one simple module that plays 3 different f4v's on radio buttons. In theory they should stream progressively in a flvplayback instance called qualtestplayer when a radio button is pushed. But they fully download before starting to play.




import flash.display.DisplayObject;
import flash.display.MovieClip;
import flash.display.Loader;
import fl.video. *;
import fl.controls.RadioButton;


stop()
import fl.video.VideoPlayer;

var film:String = "";
qualtestplayer.source = "test_1500.f4v";

highrez.addEventListener(MouseEvent.CLICK, clickHandler1);
function clickHandler1(event:MouseEvent):void {
qualtestplayer.source = "test_1500.f4v";
qualtestplayer.play();

}

dvd.addEventListener(MouseEvent.CLICK, clickHandler2);
function clickHandler2(event:MouseEvent):void {
qualtestplayer.source = "test_1200.f4v";
qualtestplayer.play();
}

lowq.addEventListener(MouseEvent.CLICK, clickHandler3);
function clickHandler3(event:MouseEvent):void {
qualtestplayer.source = "test_400.f4v";
qualtestplayer.play();
}

//THIS CODE GETS AROUND THE PROBLEM OF SKIN LOCATION//
var url:String = LoaderInfo(MovieClip(this).loaderInfo).url
var index:int = url.lastIndexOf("/");
if (index < 0)
index = url.lastIndexOf("\\");
if (index > 0)
qualtestplayer.skin = url.substring(0, index+1) + qualtestplayer.skin;

qualtestplayer.addEventListener(VideoEvent.STOPPED _STATE_ENTERED, completeHandler);
function completeHandler(event:VideoEvent):void
{

if (stage.displayState == "fullScreen")
{
stage.displayState = StageDisplayState.NORMAL;
}

}

davidc
July 7th, 2009, 07:17 AM
I changed the code to the following but still the same result.
No one has responded here. Is that because no one here is using the flvplayback component? If so is there another forum where I might have better luck?


import flash.display.DisplayObject;
import flash.display.MovieClip;
import flash.display.Loader;
import fl.video. *;
import fl.controls.RadioButton;

stop()
import fl.video.VideoPlayer;


var film:String = "";

qualtestplayer.source = "";


highrez.addEventListener(MouseEvent.CLICK, clickHandler1);
function clickHandler1(event:MouseEvent):void {
qualtestplayer.source = "test_1500.f4v";


}

dvd.addEventListener(MouseEvent.CLICK, clickHandler2);
function clickHandler2(event:MouseEvent):void {
qualtestplayer.source = "test_1200.f4v";

}

lowq.addEventListener(MouseEvent.CLICK, clickHandler3);
function clickHandler3(event:MouseEvent):void {
qualtestplayer.source = "test_400.f4v";
}



function readyHandler(event:VideoEvent):void
{
qualtestplayer.playWhenEnoughDownloaded();
}

qualtestplayer.addEventListener(VideoEvent.READY, readyHandler);

davidc
July 7th, 2009, 01:08 PM
Here's the solution

http://www.scottgmorgan.com/blog/index.php/tag/h264/