整个流式视频无法使用VideoView播放

时间:2018-04-02 13:57:47

标签: android android-studio video-streaming android-videoview

我有以下用于播放Uri视频的代码:

final MediaController mediaController = new MediaController(this);
        mediaController.setAnchorView(videoView);
        Uri uri = Uri.parse("http://mirrors.standaloneinstaller.com/video-sample/star_trails.mp4");
        videoView.setMediaController(mediaController);

        videoView.setVideoURI(uri);
        videoView.requestFocus();

        progressDialog.setMessage("Loading video.....");
        progressDialog.show();
        videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(MediaPlayer mediaPlayer) {
                progressDialog.dismiss();
                mediaController.show();
            }
        });

视频播放的前7秒,然后视频暂停。剩余的视频是缓冲的,当我寻找视频中的另一个点时,它将再播放几秒钟。

0 个答案:

没有答案