播放FLV机器人 [英] Playing flv android

查看:175
本文介绍了播放FLV机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以发挥Android的FLV流视频,而无需使用的WebView,它的速度太慢?我的意思是直接从URL播放FLV的视频。有任何想法吗? VideoView现在用FLV的链接工作。

Can we play flv stream videos in Android without using WebView, it's too slow? I mean play .flv video directly from url. Any ideas? VideoView now work with the .flv link.

推荐答案

我把它用这个code工作。您可以从设备的本地播放还是从网上流式处理。你在你的影片拖动FLV组件的实例,然后就从舞台中删除它留在你的图书馆。

I got it to work using this code. You can play it local from your device or stream it from online. You have to drag an instance of the FLV COMPONENT in your movie and then just delete it from the stage to it remains in your library.

var myVideo:FLVPlayback = new FLVPlayback();
myVideo.source = "content/video/BeauIntro.flv"; // CHANGE THIS TO YOUR FLV 
myVideo.autoPlay = true;


// I am choosing to load the flv into an empty movie but you don't have to. 
var my_mc:MovieClip = new MovieClip(); 
addChild(my_mc); 


/// These are important because it can mess up position with out it.
myVideo.align = StageAlign.TOP_LEFT;
myVideo.scaleMode = VideoScaleMode.EXACT_FIT;


// Setting the video to the screen size of device
myVideo.width = stage.stageWidth;
myVideo.height = stage.stageHeight;

// Adding my FLV into my empty movie.
my_mc.addChild(myVideo);

//Setting the empty Movie Clip for the video to the screen size of device
my_mc.width = stage.stageHeight;
my_mc.height = stage.stageHeight;


/// This will run when the video stops 
myVideo.addEventListener(fl.video.VideoEvent.COMPLETE, VideoStopped);
function VideoStopped(e:Event):void
    {
    myVideo.stop();
    myVideo.visible = false; /// I wanted it to not be seen after playing.
    trace("stopped");
    myVideo.removeEventListener(fl.video.VideoEvent.COMPLETE, VideoStopped);

    }

这篇关于播放FLV机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆