diff --git a/app/src/main/java/com/dueeeke/dkplayer/activity/api/CustomMediaPlayerActivity.java b/app/src/main/java/com/dueeeke/dkplayer/activity/api/CustomMediaPlayerActivity.java index 637a0b6a..479ae9f6 100644 --- a/app/src/main/java/com/dueeeke/dkplayer/activity/api/CustomMediaPlayerActivity.java +++ b/app/src/main/java/com/dueeeke/dkplayer/activity/api/CustomMediaPlayerActivity.java @@ -36,8 +36,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { } -// String url = "rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov"; - String rtspUrl = "rtsp://ajj:12345678@218.21.217.122:65523/h264/ch40/sub/av_stream"; + String rtspUrl = "rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov"; +// String rtspUrl = "rtsp://ajj:12345678@218.21.217.122:65523/h264/ch40/sub/av_stream"; // String rtspUrl = "rtsp://live.3gv.ifeng.com/live/71"; // String url = "http://storage.gzstv.net/uploads/media/huangmeiyan/jr05-09.mp4"; //测试concat,将项目根目录的other文件夹中的test.ffconcat文件复制到sd卡根目录测试 @@ -73,7 +73,7 @@ public void setOptions() { mMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "safe", 0); mMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "protocol_whitelist", "rtmp,concat,ffconcat,file,subfile,http,https,tls,rtp,tcp,udp,crypto,rtsp"); - //支持rtsp + //使用tcp方式拉取rtsp流,默认是通过udp方式 mMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "rtsp_transport", "tcp"); } }) diff --git a/dkplayer-java/src/main/java/com/dueeeke/videoplayer/listener/VideoListener.java b/dkplayer-java/src/main/java/com/dueeeke/videoplayer/listener/VideoListener.java index 941e87de..d032d3f1 100644 --- a/dkplayer-java/src/main/java/com/dueeeke/videoplayer/listener/VideoListener.java +++ b/dkplayer-java/src/main/java/com/dueeeke/videoplayer/listener/VideoListener.java @@ -6,18 +6,34 @@ public interface VideoListener { + /** + * 播放暂停 + */ void onVideoStarted(); + /** + * 继续播放 + */ void onVideoPaused(); - //播放完成 + /** + * 播放完成 + */ void onComplete(); - //准备完成 + /** + * 准备播放完成 + */ void onPrepared(); + /** + * 播放出错 + */ void onError(); + /** + * 播放器内部事件回调 + */ void onInfo(int what, int extra); }