android 监听视频播放完毕

 videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener()
        {
            @Override
            public void onCompletion(MediaPlayer mp)
            {
                videoView.setVideoPath(Environment.getExternalStorageDirectory().getPath()+"/sdklog/zyTest.mp4");
                videoView.start();
//                String path = Environment.getExternalStorageDirectory().getPath()+"/sdklog/zyTest.mp4";
//                Log.d(TAG, "ZYF onCompletion: "+path);
//                try {
//                    mp.setDataSource(path);
//                } catch (IOException e) {
//                    e.printStackTrace();
//                }
//                mp.seekTo(0);
//                mp.start();
            }
        });

你可能感兴趣的:(java)