首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >播放flv android

播放flv android
EN

Stack Overflow用户
提问于 2012-05-02 23:43:30
回答 2查看 1.4K关注 0票数 0

不用WebView能不能在Android下播放flv流视频,太慢了?我的意思是直接从url播放.flv视频。有什么想法吗?VideoView现在可以使用.flv链接。

EN

回答 2

Stack Overflow用户

发布于 2012-05-20 00:57:16

我使用下面的代码让它正常工作。您可以从您的设备本地播放它,也可以从在线播放它。您必须在影片中拖动FLV组件的一个实例,然后将其从舞台上删除并保留在库中。

代码语言:javascript
复制
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);

    }
票数 1
EN

Stack Overflow用户

发布于 2013-08-24 00:03:44

试试这个: String在这里;url=your =新的意图();

代码语言:javascript
复制
 intent.setAction(Intent.ACTION\_VIEW);     intent.setDataAndType(Uri.parse(url), "flv-application/octet-stream");     startActivity(intent);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10417143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档