资源描述:
《基于VlC的视频播放器(烟台返j或或杰瑞教育Android培训部原创)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、----------专业最好文档,专业为你服务,急你所急,供你所需-------------文档下载最佳的地方基于VlC的视频播放器 最近在研究视频播放的功能,之前是使用VideoView。在网上看了一下,感觉不是很好,支持的格式比较少,现在网络视频的格式各种各样,感觉用VideoView播放起来局限性很大。 找到了一个比较合适的播放器,Github地址为https://github.com/xiaomo/AndroidPlayerLibrary 。这个播放器是基于vlc这个软件,在将我们的de
2、mo导入到Eclipse中之后,可以发现,这样一个libvlc文件夹。 在Media这个类中我们可以发现,这些是支持的格式还是比较多的。String[]video_extensions={".3g2",".3gp",".3gp2",".3gpp",".amv",".asf",".avi",".divx",".drc",".dv",".f4v",".flv",".gvi",".gxf",".ismv",".iso",".m1v",".m2v",".m2t",".m2ts",".m4v",".mkv"
3、,".mov",".mp2",".mp2v",".mp4",".mp4v",".mpe",".mpeg",".mpeg1",".mpeg2",".mpeg4",".mpg",".mpv2",".mts",".mtv",".mxf",".mxg",".nsv",".nut",".nuv",".ogm",".ogv",".ogx",".ps",".rec",".rm",".rmvb",----------专业最好文档,专业为你服务,急你所急,供你所需-------------文档下载最佳的地方-----
4、-----专业最好文档,专业为你服务,急你所急,供你所需-------------文档下载最佳的地方".tod",".ts",".tts",".vob",".vro",".webm",".wm",".wmv",".wtv",".xesc"};String[]audio_extensions={".3ga",".a52",".aac",".ac3",".adt",".adts",".aif",".aifc",".aiff",".amr",".aob",".ape",".awb",".caf",".dt
5、s",".flac",".it",".m4a",".m4b",".m4p",".mid",".mka",".mlp",".mod",".mpa",".mp1",".mp2",".mp3",".mpc",".mpga",".oga",".ogg",".oma",".opus",".ra",".ram",".rmi",".s3m",".spx",".tta",".voc",".vqf",".w64",".wav",".wma",".wv",".xa",".xm"}; 在这个例子中它自己写了一个Play
6、erActivity和PlayerView,在PlayerView中实现了libvlc中的IVideoPlayer接口 在PlayerActivity中实现PlayerView类,从而进行界面和流程的控制。protectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);mUrl=getIntent().getStringExtra("url");if(TextUtils.isEmpty(mUrl)
7、){Toast.makeText(this,"error:nourlinintent!",Toast.LENGTH_SHORT).show();return;}requestWindowFeature(Window.FEATURE_NO_TITLE);getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);setContentView(R.l
8、ayout.activity_player);mHandler=newHandler(this);----------专业最好文档,专业为你服务,急你所急,供你所需-------------文档下载最佳的地方----------专业最好文档,专业为你服务,急你所急,供你所需-------------文档下载最佳的地方tvTitle=(TextView)findViewById(R.id.tv_title);tvTime=(TextView)findViewById(R