简体   繁体   English

使用VideoView在Android中播放RTSP mrl

[英]Playing RTSP mrl in Android using VideoView

I have try to play a RTSP link but unable to play in Android using Video View . 我尝试播放RTSP链接,但无法使用Video View在Android中播放。 Also tried to stream using media Player.None to them work but Its streaming smoothly in iOS. 他们也尝试使用媒体播放器进行流式传输,但都无法正常工作,但是在iOS中可以流畅地进行流式传输。

videoView.setVideoURI(Uri.parse(liveURI));
videoView.requestFocus();
videoView.start();
String  videoRtspUrl=“rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov“;

private void playInVideoView() {
VideoView videoView = (VideoView) this.findViewById(R.id.videoView);
        videoView.setVideoPath(videoRtspUrl);
        videoView.requestFocus();
        videoView.start();
}

private void playInApp(){
if (videoRtspUrl.startsWith("rtsp://")) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(videoRtspUrl));
startActivity(intent);
}

Also check for the Internet permission 同时检查互联网权限

<uses-permission android:name="android.permission.INTERNET" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM