开发者

flahvars seekbar problem

开发者 https://www.devze.com 2023-02-16 13:52 出处:网络
Hi I have a php page that echo\'s some variables in to the flashvars of a video player swf filethe flashvar \"vid_file_name\" is loaded and plays

Hi I have a php page that echo's some variables in to the flashvars of a video player swf file the flashvar "vid_file_name" is loaded and plays

But for some reason the seekbar wont work properly

when I hard code, into the php page or fla file it works fine but when echoed in the php page it fails

it doesnt seem to be an encoding issue

I placed a text field in the swf file and the file name displays And as stated before the "vid_file_name" var is imported and plays the video it's just when it comes to the seekbar code:

 import fl.video.*;


// Set Variables

var flvControl:FLVPlayback = auditionVid;
var flashVars = this.loaderInfo.parameters;
var flvSource:String = "http://www.mysite.co.uk/uploads/live/"+String(flashVars.vid_file_name);
var pageURL:String=ExternalInterface.call('window.document.location.toString');
var baseURL:String ="http://www.mysite.co.uk/";
var pageToGoTo:URLRequest;
gotoPageBtn.visible = false;
gotoPageBtn.addEventListener(MouseEvent.CLICK,pageHandler)
gotoPageBtn.buttonMode = true;
function pageHandler(evt:MouseEvent):void{
     pageToGoTo =  new URLRequest(baseURL+"audition.php?user_id="+flashVars.user_id+"&vid_id="+flashVars.vid_id+"&vid_file_name="+flashVars.vid_file_name);
    navigateToURL(pageToGoTo, "_self");

} if(pageURL==baseURL||pageURL.indexOf(".co.uk/index.php") > -1 ){ gotoPageBt开发者_开发百科n.visible = true }

function readyHandler(event:VideoEvent):void

{

// flvControl.play() flvControl.autoPlay = false;

}

flvControl.addEventListener(VideoEvent.READY, readyHandler);

flvControl.source = flvSource;
flvControl.bufferTime = Number(10);
flvControl.playPauseButton = playpausebtn; 
flvControl.muteButton = mutebtn; 
flvControl.seekBar = mySeekBar;

Does any one have any ideas?


Hi everyone I thought id answer my own question in case anyone else comes across this problem. upon further testing I found that it was the files and not the data that was in error the seekbar component needs metadata from the flv in order to work

I am using ffmpeg to convert the files to flv on upload by executing: exec('/usr/local/bin/ffmpeg -i '.$uploadFile.' -f flv '.$new_flv.'');

this was insuficient, what I needed to use was something called flvtool2

I changed the command accordingly to: exec('/usr/local/bin/ffmpeg -i '.$uploadFile.' -f flv - | flvtool2 -U stdin '.$new_flv.'');

notice the " - | flvtool2 -U stdin " this so far has cured the problem

the strange thing is that the orignal command worked at first!

I just hope this can help others

Thanks again to JornC

0

精彩评论

暂无评论...
验证码 换一张
取 消