开发者

Download video in mobile and play it using flex mobile project

I am downloading a video from internet to a mobile device and want to play it. I am unable to get the right path of that video. I don't know video will save in desktopDirectory or documentsDirectory.

I have an array that contains names of each video. Any idea how to get the path and play it in videoDisplay?

For mobile devi开发者_C百科ces, VideoDisplay is not recommended. Is there any other player to run videos on mobile device?

My code is

fr = new FileReference(); 
request = new URLRequest(file_url);
fr.download(request);
trace("Downloading "+request);

fr.addEventListener(Event.OPEN,start);                  fr.addEventListener(ProgressEvent.PROGRESS,updateProgress);
fr.addEventListener(Event.COMPLETE,complete);

private function complete(event:Event):void {
      progress_indicator.visible = false;
      progress_label.text =  "100% completed";
    trace("File: "+fr.name);
    var appmanager:ApplicationManager = ApplicationManager.SharedApplicationManager();
    appmanager.DownloadedVideos[appmanager.DownloadedVideos.length] = fr.name;
}


First, I hope you're using Flex for more than just playing a video as that would be very inefficient. Second, you should be using StageVideo to play videos on mobile devices since it's hardware accelerated. You should look at the some of the tutorials from Adobe on how to use it on devices.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜