如何使用以下链接在videoview中播放视频?

时间:2016-11-28 07:37:51

标签: android video-streaming android-videoview

链接是: http://live.ramalin.com/inter/bbc-sport.html

当我尝试在videoview中运行时,它给我带来了无法播放视频的错误

E/MediaPlayer: error (1, -2147483648)

我已经实现了videoview,如下所示

private void PlayVideo() {

        Log.e("video url", videourl);
        Uri uri = Uri.parse(videourl);
        android.widget.MediaController mediaController = new android.widget.MediaController(this);
        mediaController.setAnchorView(videoView);
        mediaController.setMediaPlayer(videoView);
        videoView.requestFocus();
        videoView.setMediaController(mediaController);
        videoView.setVideoURI(uri);

        videoView.setOnPreparedListener(new android.media.MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(android.media.MediaPlayer mp) {
                videoView.start();
            }
        });
        videoView.setOnCompletionListener(new android.media.MediaPlayer.OnCompletionListener() {
            @Override
            public void onCompletion(android.media.MediaPlayer mp) {

            }
        });
}

任何帮助都将表示感谢。

1 个答案:

答案 0 :(得分:0)

我会按照example流式传输视频。