Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
5e6232ae
Commit
5e6232ae
authored
Oct 09, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:课程播放改用IJKplayer
parent
1f9bed96
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
32 deletions
+18
-32
config.gradle
config.gradle
+4
-4
build.gradle
m-course/build.gradle
+1
-0
CoursePlayItemViewVideo.kt
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewVideo.kt
+11
-27
build.gradle
ydl-media/build.gradle
+2
-1
No files found.
config.gradle
View file @
5e6232ae
...
...
@@ -16,7 +16,7 @@ ext {
"m-muse"
:
"0.0.28.25"
,
"m-tests"
:
"0.0.24.15"
,
"m-course"
:
"0.0.4
2.82
"
,
"m-course"
:
"0.0.4
3.28
"
,
//-------------- 业务模块 API 层 --------------
"m-audioim-api"
:
"0.0.6"
,
...
...
@@ -37,7 +37,7 @@ ext {
//第二步 若干
"ydl-webview"
:
"0.0.38.47"
,
"ydl-media"
:
"0.0.21.
15
"
,
"ydl-media"
:
"0.0.21.
33
"
,
"ydl-pay"
:
"0.0.18.19"
,
"m-audioim"
:
"0.0.49.29.41"
,
"ydl-flutter-base"
:
"0.0.14.32"
,
...
...
@@ -119,7 +119,7 @@ ext {
//第二步 若干
"ydl-webview"
:
"0.0.38.47"
,
"ydl-media"
:
"0.0.21.
15
"
,
"ydl-media"
:
"0.0.21.
33
"
,
"ydl-pay"
:
"0.0.18.19"
,
"m-audioim"
:
"0.0.49.29.41"
,
"ydl-flutter-base"
:
"0.0.14.32"
,
...
...
@@ -220,7 +220,7 @@ ext {
"systembartint"
:
"com.readystatesoftware.systembartint:systembartint:1.0.3"
,
"cube"
:
"in.srain.cube:cube-sdk:1.0.44@aar"
,
"support-multidex"
:
'androidx.multidex:multidex:2.0.0'
,
"ydl-ijkplayer-jjdxm"
:
"com.ydl:jjdxm-ijkplayer:0.0.
9
"
,
"ydl-ijkplayer-jjdxm"
:
"com.ydl:jjdxm-ijkplayer:0.0.
28
"
,
"robust"
:
"com.meituan.robust:robust:0.4.87"
,
"walle"
:
"com.meituan.android.walle:library:1.1.5"
,
"jpush"
:
"cn.jiguang.sdk:jpush:3.3.6"
,
...
...
m-course/build.gradle
View file @
5e6232ae
...
...
@@ -66,6 +66,7 @@ dependencies {
api
'com.github.princekin-f:EasyFloat:1.3.2'
api
rootProject
.
ext
.
dependencies
[
"ydl-user-router"
]
api
rootProject
.
ext
.
dependencies
[
"butterknife"
]
if
(
rootProject
.
ext
.
dev_mode
){
//开发时使用
implementation
modularPublication
(
'com.ydl:m-consultant-api'
)
...
...
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewVideo.kt
View file @
5e6232ae
...
...
@@ -6,6 +6,7 @@ import android.os.Handler
import
android.os.PowerManager
import
android.view.View
import
android.widget.RelativeLayout
import
com.dou361.ijkplayer.widget.IjkVideoView
import
com.dou361.ijkplayer.widget.PlayStateParams
import
com.dou361.ijkplayer.widget.PlayerView
import
com.ydl.media.audio.utils.PlayProgressUtil
...
...
@@ -17,7 +18,9 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.yidianling.course.R
import
com.yidianling.course.bean.CourseExtraBean
import
com.yidianling.course.bean.CourseMediaBean
import
tv.danmaku.ijk.media.player.AndroidMediaPlayer
import
tv.danmaku.ijk.media.player.IMediaPlayer
import
tv.danmaku.ijk.media.player.IjkMediaPlayer
import
java.text.SimpleDateFormat
import
java.util.*
...
...
@@ -31,7 +34,6 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
private
var
playList
:
ArrayList
<
CourseMediaBean
>
=
ArrayList
()
private
var
courseExtra
:
CourseExtraBean
?
=
null
var
activity
:
CoursePlayActivity
?
=
null
var
videoUrl
:
String
?
=
null
//播放模式
...
...
@@ -163,11 +165,12 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
// url = url.replace("https", "http")
videoUrl
=
url
var
hisTime
=
PlayProgressUtil
.
getProgress
(
context
,
url
)
try
{
activity
?.
videoView
=
PlayerView
(
activity
)
/*
activity?.videoView = PlayerView(activity)
.setScaleType(PlayStateParams.fitparent)
.hideMenu(true)
.hideRotation(true)
...
...
@@ -178,6 +181,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
.forbidTouch(false)
.setOnInfoListener(object : IMediaPlayer.OnInfoListener {
override fun onInfo(mp: IMediaPlayer, what: Int, extra: Int): Boolean {
LogUtil.e("课程播放--状态-$what")
if (what == PlayStateParams.MEDIA_INFO_VIDEO_INTERRUPT) {
activity?.videoView?.startPlay()
...
...
@@ -242,34 +246,14 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
.into(ivThumbnail)
}
}
.setPlaySource(url)
.
startPlay
()
.seekTo(hisTime)
// try {
// 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)
activity?.videoView?.setPlaySource(url)
activity?.videoView?.startPlay()
val layout = activity?.window?.attributes
layout?.screenBrightness = -1f
activity
?.
window
?.
attributes
=
layout
activity?.window?.attributes = layout
*/
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
...
...
ydl-media/build.gradle
View file @
5e6232ae
...
...
@@ -39,7 +39,8 @@ dependencies {
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api
(
rootProject
.
ext
.
dependencies
[
"ydl-ijkplayer-jjdxm"
])
{
api
(
rootProject
.
ext
.
dependencies
[
""
+
"ydl-ijkplayer-jjdxm"
])
{
exclude
group:
'com.android.support'
,
module:
'appcompat-v7'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment