我试图开发电视流(HLS)的应用程序。使用下面的代码我测试了2.3.3,3.0和4.0.1版Android设备上的流,但遇到了几个问题。 在Android 2.3.3上,播放时间大于1分钟,然后停止播放。在Android 3.0上播放良好,在Android 4.0.3上显示消息'This file can not be playing'(如果我没有记错的话)。 所以我的问题是: 如何在这些设备的ether上播放流,而不会产生流播放问题?或者我可以在哪里关于这些问题的解决方案(尝试搜索,但没有发现任何用处)?Android VideoView直播电视流(HLS)
守则Main_Activity:
@Override
public void onCreate(Bundle savedInstanceState) {
hls工具、super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
VideoView player = (VideoView)findViewById(R.id.player);
String httpLiveUrl = "http://aj.lsops.net/live/aljazeer_en_high.sdp/playlist.m3u8";
//for Android 2.3.3 I used httplive:// prefix
android。player.setVideoURI(Uri.parse(httpLiveUrl));
player.setMediaController(new MediaController(this));
player.requestFocus();
player.start();
}
4.4?@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
安卓4.4.2怎么升级?代码中的XML:
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
安卓4.4.4怎么升级。
android:id="@+id/player"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" />
安卓4.4.4怎么升级5.0。很抱歉,如果我的英语很差。 谢谢。
+0
请分享您如何播放直播印地语频道? –
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态