在android 3.2中播放m3u8文件的问题
我正在尝试在 Android 中播放苹果测试流视频 (.m3u8)。
这是链接:http://devimages.apple.com/iphone/ Samples/bibpbop/gear1/prog_index.m3u8
但我无法在 Android 3.2
中播放它。
这是我用来播放视频的代码:
void playVideo(String url)
{
String link=url;
Log.e("url",link);
MediaController mc = new MediaController(this);
mc.setMediaPlayer(videoview);
videoview.setMediaController(mc);
videoview.setVideoURI(Uri.parse("http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"));
videoview.requestFocus();
videoview.start();
}
请建议我在不同 Android 版本中播放 m3u8 文件的方法。
I am trying to play apple test stream video (.m3u8) in Android.
This is the link: http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8
But I am not able to play it in Android 3.2
.
This is the code I have used to play the video:
void playVideo(String url)
{
String link=url;
Log.e("url",link);
MediaController mc = new MediaController(this);
mc.setMediaPlayer(videoview);
videoview.setMediaController(mc);
videoview.setVideoURI(Uri.parse("http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"));
videoview.requestFocus();
videoview.start();
}
Please, suggest me the way to play m3u8 file in different Android versions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尝试过 vitamio 吗?它是一个扩展框架,可以执行 MediaPlayer 执行的所有操作(以及一些操作),包括 m3u8 流。
Have you tried vitamio? It's an extension framework that does everything (and then some) that MediaPlayer does, including m3u8 streams.