0

我们可以在不使用 WebView 的情况下在 Android 中播放 flv 流视频吗,它太慢了?我的意思是直接从 url 播放 .flv 视频。有任何想法吗?VideoView 现在可以使用 .flv 链接。

4

2 回答 2

1

我让它使用这个代码工作。您可以从您的设备本地播放它或从在线流式传输它。您必须在电影中拖动 FLV 组件的一个实例,然后将其从舞台上删除,使其保留在您的库中。

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);

    }
于 2012-05-19T16:57:15.577 回答
0

试试这个:String url=你的网址;意图意图 = new Intent();
意图.setAction(意图.ACTION_VIEW);intent.setDataAndType(Uri.parse(url), "flv-application/octet-stream"); 开始活动(意图);

于 2013-08-23T16:03:43.833 回答