Commit caa66334 by 霍志良

feat:视频播放组件升级

parent 0c57dd20
...@@ -16,7 +16,7 @@ ext { ...@@ -16,7 +16,7 @@ ext {
"m-muse" : "0.0.28.27", "m-muse" : "0.0.28.27",
"m-tests" : "0.0.24.15", "m-tests" : "0.0.24.15",
"m-course" : "0.0.43.32", "m-course" : "0.0.43.36",
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6", "m-audioim-api" : "0.0.6",
...@@ -37,7 +37,7 @@ ext { ...@@ -37,7 +37,7 @@ ext {
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.47", "ydl-webview" : "0.0.38.47",
"ydl-media" : "0.0.21.37", "ydl-media" : "0.0.21.42",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.41", "m-audioim" : "0.0.49.29.41",
"ydl-flutter-base": "0.0.14.32", "ydl-flutter-base": "0.0.14.32",
...@@ -99,7 +99,7 @@ ext { ...@@ -99,7 +99,7 @@ ext {
"m-muse" : "0.0.28.27", "m-muse" : "0.0.28.27",
"m-tests" : "0.0.24.15", "m-tests" : "0.0.24.15",
"m-course" : "0.0.43.32", "m-course" : "0.0.43.36",
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6", "m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.11", "m-confide-api" : "0.0.2.11",
...@@ -119,7 +119,7 @@ ext { ...@@ -119,7 +119,7 @@ ext {
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.47", "ydl-webview" : "0.0.38.47",
"ydl-media" : "0.0.21.37", "ydl-media" : "0.0.21.42",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.41", "m-audioim" : "0.0.49.29.41",
"ydl-flutter-base": "0.0.14.32", "ydl-flutter-base": "0.0.14.32",
...@@ -220,7 +220,7 @@ ext { ...@@ -220,7 +220,7 @@ ext {
"systembartint" : "com.readystatesoftware.systembartint:systembartint:1.0.3", "systembartint" : "com.readystatesoftware.systembartint:systembartint:1.0.3",
"cube" : "in.srain.cube:cube-sdk:1.0.44@aar", "cube" : "in.srain.cube:cube-sdk:1.0.44@aar",
"support-multidex" : 'androidx.multidex:multidex:2.0.0', "support-multidex" : 'androidx.multidex:multidex:2.0.0',
"ydl-ijkplayer-jjdxm" : "com.ydl:jjdxm-ijkplayer:0.0.29", "ydl-ijkplayer-jjdxm" : "com.ydl:jjdxm-ijkplayer:0.0.33",
"robust" : "com.meituan.robust:robust:0.4.87", "robust" : "com.meituan.robust:robust:0.4.87",
"walle" : "com.meituan.android.walle:library:1.1.5", "walle" : "com.meituan.android.walle:library:1.1.5",
"jpush" : "cn.jiguang.sdk:jpush:3.3.6", "jpush" : "cn.jiguang.sdk:jpush:3.3.6",
......
...@@ -170,7 +170,8 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface { ...@@ -170,7 +170,8 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
try { try {
/* activity?.videoView = PlayerView(activity)
activity?.videoView = PlayerView(activity)
.setScaleType(PlayStateParams.fitparent) .setScaleType(PlayStateParams.fitparent)
.hideMenu(true) .hideMenu(true)
.hideRotation(true) .hideRotation(true)
...@@ -181,7 +182,6 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface { ...@@ -181,7 +182,6 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
.forbidTouch(false) .forbidTouch(false)
.setOnInfoListener(object : IMediaPlayer.OnInfoListener { .setOnInfoListener(object : IMediaPlayer.OnInfoListener {
override fun onInfo(mp: IMediaPlayer, what: Int, extra: Int): Boolean { override fun onInfo(mp: IMediaPlayer, what: Int, extra: Int): Boolean {
LogUtil.e("课程播放--状态-$what") LogUtil.e("课程播放--状态-$what")
if (what == PlayStateParams.MEDIA_INFO_VIDEO_INTERRUPT) { if (what == PlayStateParams.MEDIA_INFO_VIDEO_INTERRUPT) {
activity?.videoView?.startPlay() activity?.videoView?.startPlay()
...@@ -246,14 +246,34 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface { ...@@ -246,14 +246,34 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
.into(ivThumbnail) .into(ivThumbnail)
} }
} }
.setPlaySource(url) .setPlaySource(url)
.startPlay()
.seekTo(hisTime) .seekTo(hisTime)
activity?.videoView?.setPlaySource(url) // try {
activity?.videoView?.startPlay() // var videoViewField =
// activity?.videoView.run { javaClass.getDeclaredField("videoView") }
// videoViewField.isAccessible = true
//
// var ijkVideoView = videoViewField.get(activity?.videoView) as IjkVideoView
// var mMediaPlayerField = ijkVideoView.javaClass.getDeclaredField("mMediaPlayer")
//
// var mMediaPlayerObject = mMediaPlayerField.get(ijkVideoView)
// if (mMediaPlayerObject is IjkMediaPlayer) {
// mMediaPlayerObject.setOption(
// IjkMediaPlayer.OPT_CATEGORY_FORMAT,
// "dns_cache_clear",
// 1
// )
// }
// } catch (e: java.lang.Exception) {
//
// }
//
// activity?.videoView?.startPlay()?.seekTo(hisTime)
val layout = activity?.window?.attributes val layout = activity?.window?.attributes
layout?.screenBrightness = -1f layout?.screenBrightness = -1f
activity?.window?.attributes = layout*/ activity?.window?.attributes = layout
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment