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
ff0a1570
Commit
ff0a1570
authored
Jun 30, 2022
by
范玉宾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
meditation share to miniWX feat done
parent
59b07fb3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
167 additions
and
110 deletions
+167
-110
config.gradle
config.gradle
+2
-2
PlayMeditationActivity.kt
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
+116
-79
MeditationPlayModuleBean.kt
m-muse/src/main/java/com/yidianling/muse/bean/MeditationPlayModuleBean.kt
+25
-20
ShareMeditationDialog.kt
m-muse/src/main/java/com/yidianling/muse/widget/ShareMeditationDialog.kt
+24
-9
No files found.
config.gradle
View file @
ff0a1570
...
@@ -13,7 +13,7 @@ ext {
...
@@ -13,7 +13,7 @@ ext {
"m-im"
:
"0.0.21.64"
,
"m-im"
:
"0.0.21.64"
,
"m-dynamic"
:
"0.0.7.74"
,
"m-dynamic"
:
"0.0.7.74"
,
"m-article"
:
"0.0.0.10"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.8
1
"
,
"m-muse"
:
"0.0.28.8
2
"
,
"m-tests"
:
"0.0.24.18"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.39"
,
"m-course"
:
"0.0.43.39"
,
...
@@ -100,7 +100,7 @@ ext {
...
@@ -100,7 +100,7 @@ ext {
"m-dynamic"
:
"0.0.7.74"
,
"m-dynamic"
:
"0.0.7.74"
,
"m-article"
:
"0.0.0.10"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.8
1
"
,
"m-muse"
:
"0.0.28.8
2
"
,
"m-tests"
:
"0.0.24.18"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.39"
,
"m-course"
:
"0.0.43.39"
,
...
...
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
View file @
ff0a1570
package
com.yidianling.muse.activity
package
com.yidianling.muse.activity
//import com.yidianling.muse.dialog.ChooseMusicDialog
import
android.content.Intent
import
android.content.Intent
import
android.media.MediaPlayer
import
android.media.MediaPlayer
import
android.os.Bundle
import
android.os.Bundle
...
@@ -17,6 +16,7 @@ import com.ydl.ydlcommon.base.BaseActivity
...
@@ -17,6 +16,7 @@ import com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.event.MeditationEvent
import
com.ydl.ydlcommon.event.MeditationEvent
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.remind.ToastHelper.Companion.show
import
com.ydl.ydlcommon.utils.remind.ToastHelper.Companion.show
...
@@ -58,6 +58,11 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -58,6 +58,11 @@ class PlayMeditationActivity : BaseActivity() {
private
var
mMediaUrl
=
""
private
var
mMediaUrl
=
""
private
var
mMediaCoverUrl
=
""
private
var
mMediaCoverUrl
=
""
private
var
mMinProgramId
:
String
?
=
null
private
var
mCateId
:
Int
?
=
null
private
var
mTagId
:
String
?
=
null
private
var
mMark
:
Int
?
=
null
private
var
mTitle
=
""
private
var
mTitle
=
""
private
var
mDesc
=
""
private
var
mDesc
=
""
private
var
mStatus
=
0
private
var
mStatus
=
0
...
@@ -90,6 +95,11 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -90,6 +95,11 @@ class PlayMeditationActivity : BaseActivity() {
private
var
mBuried
:
String
?
=
null
private
var
mBuried
:
String
?
=
null
private
var
mVideoId
:
String
?
=
null
private
var
mIndexForMini
=
0
private
var
mMinProgramPath
:
String
?
=
null
/**
/**
* 传递过来的mediaId 用于判断正在播放的是否是同一条音频
* 传递过来的mediaId 用于判断正在播放的是否是同一条音频
*/
*/
...
@@ -139,6 +149,11 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -139,6 +149,11 @@ class PlayMeditationActivity : BaseActivity() {
val
module
=
it
.
data
val
module
=
it
.
data
mMediaId
=
module
.
mediaId
mMediaId
=
module
.
mediaId
mMinProgramId
=
module
.
minProgramId
mCateId
=
module
.
cateId
mTagId
=
module
.
tagId
mMark
=
module
.
mark
meditations
.
clear
()
meditations
.
clear
()
module
.
mediaList
?.
forEach
{
meditationPlayBean
->
module
.
mediaList
?.
forEach
{
meditationPlayBean
->
...
@@ -148,7 +163,10 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -148,7 +163,10 @@ class PlayMeditationActivity : BaseActivity() {
if
(
meditationPlayBean
.
mediaId
==
mMediaId
)
{
if
(
meditationPlayBean
.
mediaId
==
mMediaId
)
{
currentMeditation
=
currentMeditation
=
meditationPlayBean
.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
!!
)
meditationPlayBean
.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
!!
)
mMediaId
=
module
?.
mediaId
?:
0L
mMediaId
=
module
?.
mediaId
?:
0L
mTitle
=
meditationPlayBean
.
title
mTitle
=
meditationPlayBean
.
title
...
@@ -168,49 +186,21 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -168,49 +186,21 @@ class PlayMeditationActivity : BaseActivity() {
collected
=
mStatus
==
1
collected
=
mStatus
==
1
mVideoId
=
meditationPlayBean
.
videoId
mIndexForMini
=
0
updateUI
()
updateUI
()
initMediaPlayer
(
mMediaUrl
,
currentPosition
,
mMediaIdFromLocal
==
mMediaId
)
formatMiniPath
()
}
}
initMediaPlayer
(
mMediaUrl
,
// mediaListLink = module.playDetailUrl?:""
currentPosition
,
//
mMediaIdFromLocal
==
mMediaId
// val mediaList = module.mediaList
)
// if(!mediaList.isNullOrEmpty()){
}
// val meditation = mediaList[0]
}
//
//
//
// currentMeditation = meditation.copy(meditationType = mMeditationType,meditationId = mMeditationId!!)
// mTitle = meditation.title
// mDesc = meditation.desc?:""
// mMediaUrl = meditation.mediaUrl
// mMediaCoverUrl = meditation.coverImageUrl
// val currentPosition = meditation.broadcastTime
// mBusinessType = meditation.businessType
// mBuried = meditation.buried
// mStatus = meditation.status
//
// collected = mStatus == 1
//
// updateUI()
//
// initMediaPlayer(
// mMediaUrl,
// currentPosition,
// mMediaIdFromLocal == mMediaId
// )
//
// //快进点击事件
// ActionCountUtils.baiDuCountSign3(
// MuseBIConstants.YDL_MUSE_MEDITATION_MUSIC_PLAY_PAGE,
// MuseBIConstants.YDL_MUSE_PLAY_PAGE_VISIT,
// currentMeditation?.title ?: "",
// mBuried ?: "",
// ""
// )
// }
}
}
},
object
:
ThrowableConsumer
()
{
},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
override
fun
accept
(
msg
:
String
)
{
...
@@ -231,17 +221,26 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -231,17 +221,26 @@ class PlayMeditationActivity : BaseActivity() {
val
module
=
it
.
data
val
module
=
it
.
data
mMediaId
=
module
.
mediaId
mMediaId
=
module
.
mediaId
mMinProgramId
=
module
.
minProgramId
mCateId
=
module
.
cateId
mTagId
=
module
.
tagId
mMark
=
module
.
mark
meditations
.
clear
()
meditations
.
clear
()
module
.
mediaList
?.
forEach
{
meditationPlayBean
->
module
.
mediaList
?.
forEach
Indexed
{
index
,
meditationPlayBean
->
meditations
.
add
(
meditationPlayBean
)
meditations
.
add
(
meditationPlayBean
)
if
(
meditationPlayBean
.
mediaId
==
mMediaId
)
{
if
(
meditationPlayBean
.
mediaId
==
mMediaId
)
{
mIndexForMini
=
index
currentMeditation
=
currentMeditation
=
meditationPlayBean
.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
!!
)
meditationPlayBean
.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
!!
)
mMediaId
=
module
?.
mediaId
?:
0L
mMediaId
=
module
?.
mediaId
?:
0L
mTitle
=
meditationPlayBean
.
title
mTitle
=
meditationPlayBean
.
title
...
@@ -261,9 +260,17 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -261,9 +260,17 @@ class PlayMeditationActivity : BaseActivity() {
collected
=
mStatus
==
1
collected
=
mStatus
==
1
mVideoId
=
meditationPlayBean
.
videoId
formatMiniPath
()
updateUI
()
updateUI
()
initMediaPlayer
(
mMediaUrl
,
currentPosition
,
mMediaIdFromLocal
==
mMediaId
)
initMediaPlayer
(
mMediaUrl
,
currentPosition
,
mMediaIdFromLocal
==
mMediaId
)
}
}
}
}
}
}
...
@@ -322,7 +329,7 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -322,7 +329,7 @@ class PlayMeditationActivity : BaseActivity() {
""
""
)
)
if
(!
mediaListLink
.
isNullOrBlank
())
{
if
(!
mediaListLink
.
isNullOrBlank
())
{
ChooseMusicActivity
.
launch
(
this
,
H5Params
(
mediaListLink
,
""
)
)
ChooseMusicActivity
.
launch
(
this
,
H5Params
(
mediaListLink
,
""
)
)
}
}
}
}
...
@@ -392,7 +399,7 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -392,7 +399,7 @@ class PlayMeditationActivity : BaseActivity() {
""
""
)
)
if
(
mMeditationType
==
0
)
{
if
(
mMeditationType
==
0
)
{
if
(
mMeditationId
!=
null
&&
mMediaId
!=
null
)
{
if
(
mMeditationId
!=
null
&&
mMediaId
!=
null
)
{
MediaPlayerTimeUtil
.
uploadPlayRecord
(
MediaPlayerTimeUtil
.
uploadPlayRecord
(
meditationId
=
mMeditationId
!!
.
toInt
(),
meditationId
=
mMeditationId
!!
.
toInt
(),
...
@@ -407,7 +414,7 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -407,7 +414,7 @@ class PlayMeditationActivity : BaseActivity() {
finish
()
finish
()
}
}
}
else
{
}
else
{
if
(
quitDialog
==
null
)
{
if
(
quitDialog
==
null
)
{
quitDialog
=
QuitMeditationDialog
.
newInstance
()
quitDialog
=
QuitMeditationDialog
.
newInstance
()
}
}
...
@@ -441,9 +448,13 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -441,9 +448,13 @@ class PlayMeditationActivity : BaseActivity() {
mBuried
?:
""
,
mBuried
?:
""
,
""
""
)
)
val
event
=
MeditationFloatEvent
(
true
,
val
event
=
MeditationFloatEvent
(
meditation
=
currentMeditation
?.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
true
,
mMeditationId
?:
0
))
meditation
=
currentMeditation
?.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
?:
0
)
)
EventBus
.
getDefault
().
post
(
event
)
EventBus
.
getDefault
().
post
(
event
)
Handler
().
postDelayed
({
Handler
().
postDelayed
({
...
@@ -466,13 +477,15 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -466,13 +477,15 @@ class PlayMeditationActivity : BaseActivity() {
shareTitle
=
mTitle
,
shareTitle
=
mTitle
,
shareContent
=
mDesc
,
shareContent
=
mDesc
,
shareUrl
=
mMediaUrl
,
shareUrl
=
mMediaUrl
,
shareImageUrl
=
mMediaCoverUrl
shareImageUrl
=
mMediaCoverUrl
,
miniId
=
"gh_c154608001f0"
,
// miniId = mMinProgramId!!,
miniPath
=
mMinProgramPath
!!
)
)
}
}
if
(
shareDialog
!=
null
&&
shareDialog
?.
isAdded
==
false
)
{
if
(
shareDialog
!=
null
&&
shareDialog
?.
isAdded
==
false
)
{
shareDialog
?.
show
(
supportFragmentManager
,
ShareMeditationDialog
.
TAG
)
shareDialog
?.
show
(
supportFragmentManager
,
ShareMeditationDialog
.
TAG
)
}
}
}
}
iv_time_off
.
setOnClickListener
{
iv_time_off
.
setOnClickListener
{
...
@@ -485,7 +498,7 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -485,7 +498,7 @@ class PlayMeditationActivity : BaseActivity() {
""
""
)
)
val
intent
=
Intent
(
this
,
MeditationTimeOffActivity
::
class
.
java
)
val
intent
=
Intent
(
this
,
MeditationTimeOffActivity
::
class
.
java
)
intent
.
putExtra
(
"BG_IMAGE_URL"
,
mMediaCoverUrl
)
intent
.
putExtra
(
"BG_IMAGE_URL"
,
mMediaCoverUrl
)
startActivityForResult
(
intent
,
request_code
)
startActivityForResult
(
intent
,
request_code
)
}
}
...
@@ -499,7 +512,7 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -499,7 +512,7 @@ class PlayMeditationActivity : BaseActivity() {
""
""
)
)
val
intent
=
Intent
(
this
,
MeditationTimeOffActivity
::
class
.
java
)
val
intent
=
Intent
(
this
,
MeditationTimeOffActivity
::
class
.
java
)
intent
.
putExtra
(
"BG_IMAGE_URL"
,
mMediaCoverUrl
)
intent
.
putExtra
(
"BG_IMAGE_URL"
,
mMediaCoverUrl
)
startActivityForResult
(
intent
,
request_code
)
startActivityForResult
(
intent
,
request_code
)
}
}
...
@@ -578,7 +591,7 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -578,7 +591,7 @@ class PlayMeditationActivity : BaseActivity() {
)
)
var
currentPosition
=
0
var
currentPosition
=
0
meditations
?.
forEachIndexed
{
index
,
meditationDetail
->
meditations
?.
forEachIndexed
{
index
,
meditationDetail
->
if
(
meditationDetail
.
mediaId
==
mMediaId
){
if
(
meditationDetail
.
mediaId
==
mMediaId
)
{
currentPosition
=
index
currentPosition
=
index
}
}
}
}
...
@@ -595,17 +608,22 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -595,17 +608,22 @@ class PlayMeditationActivity : BaseActivity() {
)
)
val
meditation
=
meditations
[
currentPosition
-
1
]
val
meditation
=
meditations
[
currentPosition
-
1
]
currentMeditation
=
meditation
.
copy
(
meditationId
=
mMeditationId
!!
)
currentMeditation
=
meditation
.
copy
(
meditationId
=
mMeditationId
!!
)
mMediaId
=
meditation
.
mediaId
mMediaId
=
meditation
.
mediaId
mMediaCoverUrl
=
meditation
.
coverImageUrl
mMediaCoverUrl
=
meditation
.
coverImageUrl
mMediaUrl
=
meditation
.
mediaUrl
mMediaUrl
=
meditation
.
mediaUrl
val
currentPosition
=
meditation
.
broadcastTime
mStatus
=
meditation
.
status
mStatus
=
meditation
.
status
mTitle
=
meditation
.
title
mTitle
=
meditation
.
title
mDesc
=
meditation
.
title
mDesc
=
meditation
.
title
mVideoId
=
meditation
.
videoId
mIndexForMini
=
currentPosition
-
1
formatMiniPath
()
updateUI
(
needRefresh
=
false
)
updateUI
(
needRefresh
=
false
)
initMediaPlayer
(
mMediaUrl
,
0
,
mMediaIdFromLocal
==
mMediaId
)
initMediaPlayer
(
mMediaUrl
,
0
,
mMediaIdFromLocal
==
mMediaId
)
...
@@ -627,7 +645,7 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -627,7 +645,7 @@ class PlayMeditationActivity : BaseActivity() {
)
)
var
currentPosition
=
0
var
currentPosition
=
0
meditations
?.
forEachIndexed
{
index
,
meditationDetail
->
meditations
?.
forEachIndexed
{
index
,
meditationDetail
->
if
(
meditationDetail
.
mediaId
==
mMediaId
){
if
(
meditationDetail
.
mediaId
==
mMediaId
)
{
currentPosition
=
index
currentPosition
=
index
}
}
}
}
...
@@ -655,6 +673,11 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -655,6 +673,11 @@ class PlayMeditationActivity : BaseActivity() {
mTitle
=
meditation
.
title
mTitle
=
meditation
.
title
mDesc
=
meditation
.
title
mDesc
=
meditation
.
title
mVideoId
=
meditation
.
videoId
mIndexForMini
=
currentMeditationIndex
+
1
formatMiniPath
()
updateUI
(
needRefresh
=
false
)
updateUI
(
needRefresh
=
false
)
...
@@ -743,10 +766,11 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -743,10 +766,11 @@ class PlayMeditationActivity : BaseActivity() {
})
})
val
isLoop
=
MediaPlayerManager
.
getInstance
(
this
@PlayMeditationActivity
)
?.
getTimeOffStatus
()
==
true
val
isLoop
=
MediaPlayerManager
.
getInstance
(
this
@PlayMeditationActivity
)
?.
getTimeOffStatus
()
==
true
initPlayCompletionListener
(
isLoop
=
isLoop
)
initPlayCompletionListener
(
isLoop
=
isLoop
)
MeditationFloatPermissionUtil
.
checkSuspendedWindowPermission
(
this
){
MeditationFloatPermissionUtil
.
checkSuspendedWindowPermission
(
this
)
{
}
}
...
@@ -756,9 +780,9 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -756,9 +780,9 @@ class PlayMeditationActivity : BaseActivity() {
mMediaPlayer
?.
setOnCompletionListener
{
mMediaPlayer
?.
setOnCompletionListener
{
val
duration
=
currentMeditation
?.
duration
?.
toInt
()
?:
0
val
duration
=
currentMeditation
?.
duration
?.
toInt
()
?:
0
val
currentDuration
=
(
mMediaPlayer
?.
currentPosition
?:
0
)/
1000
val
currentDuration
=
(
mMediaPlayer
?.
currentPosition
?:
0
)
/
1000
if
(
currentDuration
==
duration
)
{
if
(
currentDuration
==
duration
)
{
val
playTime
=
(
seekbar_play_progress
.
progress
/
1000.00
).
roundToInt
()
val
playTime
=
(
seekbar_play_progress
.
progress
/
1000.00
).
roundToInt
()
MediaPlayerTimeUtil
.
uploadPlayRecord
(
MediaPlayerTimeUtil
.
uploadPlayRecord
(
...
@@ -770,11 +794,10 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -770,11 +794,10 @@ class PlayMeditationActivity : BaseActivity() {
)
)
}
}
if
(
isLoop
){
if
(
isLoop
)
{
if
(
isSingle
||
meditations
.
size
==
1
)
{
if
(
isSingle
||
meditations
.
size
==
1
)
{
switchSound
()
switchSound
()
// MediaPlayerManager.getInstance(this)?.setAudioPath(mMediaUrl)
}
else
{
}
else
{
switchSound
()
switchSound
()
}
}
}
}
...
@@ -796,18 +819,20 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -796,18 +819,20 @@ class PlayMeditationActivity : BaseActivity() {
}
}
private
fun
switchSound
(){
private
fun
switchSound
()
{
var
meditation
:
MeditationPlayModuleBean
.
MeditationDetail
?
=
null
var
meditation
:
MeditationPlayModuleBean
.
MeditationDetail
?
=
null
meditations
?.
forEachIndexed
{
index
,
meditationDetail
->
meditations
?.
forEachIndexed
{
index
,
meditationDetail
->
if
(
meditationDetail
.
mediaId
==
mMediaId
){
if
(
meditationDetail
.
mediaId
==
mMediaId
)
{
currentMeditationIndex
=
index
currentMeditationIndex
=
index
}
}
}
}
if
(
mMeditationId
==
null
||
mMediaId
==
null
)
return
if
(
mMeditationId
==
null
||
mMediaId
==
null
)
return
if
(
currentMeditationIndex
<
meditations
.
size
-
1
)
{
if
(
currentMeditationIndex
<
meditations
.
size
-
1
)
{
meditation
=
meditations
[
currentMeditationIndex
+
1
]
meditation
=
meditations
[
currentMeditationIndex
+
1
]
mIndexForMini
=
currentMeditationIndex
+
1
}
else
{
}
else
{
meditation
=
meditations
[
0
]
meditation
=
meditations
[
0
]
mIndexForMini
=
0
}
}
currentMeditation
=
meditation
.
copy
(
meditationId
=
mMeditationId
!!
)
currentMeditation
=
meditation
.
copy
(
meditationId
=
mMeditationId
!!
)
...
@@ -819,6 +844,10 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -819,6 +844,10 @@ class PlayMeditationActivity : BaseActivity() {
mTitle
=
meditation
.
title
mTitle
=
meditation
.
title
mDesc
=
meditation
.
title
mDesc
=
meditation
.
title
mVideoId
=
meditation
.
videoId
formatMiniPath
()
updateUI
(
needRefresh
=
false
)
updateUI
(
needRefresh
=
false
)
initMediaPlayer
(
mMediaUrl
,
0
,
mMediaIdFromLocal
==
mMediaId
)
initMediaPlayer
(
mMediaUrl
,
0
,
mMediaIdFromLocal
==
mMediaId
)
...
@@ -826,7 +855,7 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -826,7 +855,7 @@ class PlayMeditationActivity : BaseActivity() {
private
fun
initMediaPlayer
(
path
:
String
,
current
:
Int
,
isSameOne
:
Boolean
=
false
)
{
private
fun
initMediaPlayer
(
path
:
String
,
current
:
Int
,
isSameOne
:
Boolean
=
false
)
{
if
(
MediaPlayerManager
.
getInstance
(
this
)
?.
getAudioPath
()
!=
null
&&
if
(
MediaPlayerManager
.
getInstance
(
this
)
?.
getAudioPath
()
!=
null
&&
MediaPlayerManager
.
getInstance
(
this
)
?.
getMediaId
()
==
mMediaId
MediaPlayerManager
.
getInstance
(
this
)
?.
getMediaId
()
==
mMediaId
)
{
)
{
if
(
mMediaPlayer
?.
isPlaying
==
true
)
{
if
(
mMediaPlayer
?.
isPlaying
==
true
)
{
...
@@ -888,7 +917,8 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -888,7 +917,8 @@ class PlayMeditationActivity : BaseActivity() {
mTimer
.
schedule
(
object
:
TimerTask
()
{
mTimer
.
schedule
(
object
:
TimerTask
()
{
override
fun
run
()
{
override
fun
run
()
{
if
(!
isSeekbarChanging
)
{
if
(!
isSeekbarChanging
)
{
seekbar_play_progress
.
progress
=
mMediaPlayer
?.
currentPosition
?:
0
seekbar_play_progress
.
progress
=
mMediaPlayer
?.
currentPosition
?:
0
}
}
}
}
},
0
,
50
)
},
0
,
50
)
...
@@ -921,7 +951,7 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -921,7 +951,7 @@ class PlayMeditationActivity : BaseActivity() {
MediaPlayerManager
.
getInstance
(
this
)
?.
setTimeOffStatus
(
true
)
MediaPlayerManager
.
getInstance
(
this
)
?.
setTimeOffStatus
(
true
)
initRxTimeOff
((
minute
*
60
*
1000
).
toLong
(),
1
)
initRxTimeOff
((
minute
*
60
*
1000
).
toLong
(),
1
)
}
}
val
event
=
MeditationFloatEvent
(
false
,
time
=
(
minute
*
60
*
1000
).
toLong
())
val
event
=
MeditationFloatEvent
(
false
,
time
=
(
minute
*
60
*
1000
).
toLong
())
EventBus
.
getDefault
().
post
(
event
)
EventBus
.
getDefault
().
post
(
event
)
}
else
{
}
else
{
initPlayCompletionListener
()
initPlayCompletionListener
()
...
@@ -931,13 +961,13 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -931,13 +961,13 @@ class PlayMeditationActivity : BaseActivity() {
tv_time_off
.
visibility
=
View
.
GONE
tv_time_off
.
visibility
=
View
.
GONE
tv_time_off_pure_music
.
visibility
=
View
.
GONE
tv_time_off_pure_music
.
visibility
=
View
.
GONE
mMediaPlayer
?.
isLooping
=
false
mMediaPlayer
?.
isLooping
=
false
val
event
=
MeditationFloatEvent
(
false
,
time
=
0
)
val
event
=
MeditationFloatEvent
(
false
,
time
=
0
)
EventBus
.
getDefault
().
post
(
event
)
EventBus
.
getDefault
().
post
(
event
)
}
}
}
}
}
}
private
fun
updateUI
(
needRefresh
:
Boolean
=
true
)
{
private
fun
updateUI
(
needRefresh
:
Boolean
=
true
)
{
tv_title
.
text
=
mTitle
tv_title
.
text
=
mTitle
tv_content
.
text
=
mDesc
tv_content
.
text
=
mDesc
Glide
.
with
(
this
)
Glide
.
with
(
this
)
...
@@ -952,10 +982,10 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -952,10 +982,10 @@ class PlayMeditationActivity : BaseActivity() {
}
}
)
)
if
(
needRefresh
)
{
if
(
needRefresh
)
{
if
(
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOffStatus
()
==
true
)
{
if
(
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOffStatus
()
==
true
)
{
val
timeOff
=
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOff
()
val
timeOff
=
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOff
()
if
(
timeOff
!=
null
&&
timeOff
>
0
&&
mMeditationType
!=
null
)
{
if
(
timeOff
!=
null
&&
timeOff
>
0
&&
mMeditationType
!=
null
)
{
initRxTimeOff
(
timeOff
,
mMeditationType
!!
)
initRxTimeOff
(
timeOff
,
mMeditationType
!!
)
}
}
}
}
...
@@ -1064,4 +1094,10 @@ class PlayMeditationActivity : BaseActivity() {
...
@@ -1064,4 +1094,10 @@ class PlayMeditationActivity : BaseActivity() {
const
val
request_code
=
0
x0001
const
val
request_code
=
0
x0001
}
}
private
fun
formatMiniPath
()
{
mMinProgramPath
=
"/pages/player/index?meditationId=${mMeditationId}"
+
"&meditionType=${mMeditationType}&mediaId=${mMediaId}&collectStatus=${mStatus}&index=${mIndexForMini}&videoId=${mVideoId}&cateId=${mCateId}&mark=${mMark}&tagId=${mTagId}"
LogUtil
.
d
(
"Lancet======"
,
mMinProgramPath
)
}
}
}
\ No newline at end of file
m-muse/src/main/java/com/yidianling/muse/bean/MeditationPlayModuleBean.kt
View file @
ff0a1570
...
@@ -5,31 +5,36 @@ package com.yidianling.muse.bean
...
@@ -5,31 +5,36 @@ package com.yidianling.muse.bean
* Created by xj on 2019/9/16.
* Created by xj on 2019/9/16.
*/
*/
class
MeditationPlayModuleBean
:
HomeItemBaseBean
{
class
MeditationPlayModuleBean
:
HomeItemBaseBean
{
constructor
()
:
super
(
false
)
constructor
()
:
super
(
false
)
constructor
(
isRealEmpty
:
Boolean
):
super
(
isRealEmpty
)
constructor
(
isRealEmpty
:
Boolean
)
:
super
(
isRealEmpty
)
var
meditationId
:
Long
?
=
null
var
meditationId
:
Long
?
=
null
var
mediaId
:
Long
?
=
null
var
mediaId
:
Long
?
=
null
var
mediaType
:
Int
?=
null
var
mediaType
:
Int
?
=
null
var
playDetailUrl
:
String
?
=
null
var
playDetailUrl
:
String
?
=
null
val
minProgramId
:
String
?
=
null
val
cateId
:
Int
?
=
null
val
tagId
:
String
?
=
null
val
mark
:
Int
?
=
null
var
mediaList
:
ArrayList
<
MeditationDetail
>?
=
null
var
mediaList
:
ArrayList
<
MeditationDetail
>?
=
null
data class
MeditationDetail
(
data class
MeditationDetail
(
val
meditationType
:
Int
?
=
null
,
val
meditationType
:
Int
?
=
null
,
val
mediaId
:
Long
?=
null
,
val
mediaId
:
Long
?
=
null
,
val
meditationId
:
Long
,
val
meditationId
:
Long
,
val
title
:
String
,
val
title
:
String
,
val
author
:
String
,
val
author
:
String
,
val
coverImageUrl
:
String
,
val
coverImageUrl
:
String
,
val
mediaUrl
:
String
,
val
mediaUrl
:
String
,
val
duration
:
Float
?=
null
,
val
duration
:
Float
?
=
null
,
val
status
:
Int
,
val
status
:
Int
,
val
broadcastTime
:
Int
,
val
broadcastTime
:
Int
,
val
businessType
:
Int
,
val
businessType
:
Int
,
val
buried
:
String
?=
null
,
val
buried
:
String
?
=
null
,
val
desc
:
String
?=
null
,
val
desc
:
String
?
=
null
,
val
coverImageUrlIcon
:
String
val
coverImageUrlIcon
:
String
,
val
videoId
:
String
?
=
null
)
)
override
fun
toString
():
String
{
override
fun
toString
():
String
{
...
...
m-muse/src/main/java/com/yidianling/muse/widget/ShareMeditationDialog.kt
View file @
ff0a1570
...
@@ -60,10 +60,12 @@ class ShareMeditationDialog : DialogFragment() {
...
@@ -60,10 +60,12 @@ class ShareMeditationDialog : DialogFragment() {
private
fun
initView
(
view
:
View
?)
{
private
fun
initView
(
view
:
View
?)
{
val
shareImageUrl
=
arguments
?.
getString
(
KEY_SHARE_IMAGE_URL
)
?:
""
val
shareImageUrl
=
arguments
?.
getString
(
KEY_SHARE_IMAGE_URL
)
?:
""
val
shareTitle
=
arguments
?.
getString
(
KEY_SHARE_TITLE
)
?:
""
val
shareTitle
=
arguments
?.
getString
(
KEY_SHARE_TITLE
)
?:
""
val
shareContent
=
arguments
?.
getString
(
KEY_SHARE_CONTENT
)
?:
""
val
shareContent
=
arguments
?.
getString
(
KEY_SHARE_CONTENT
)
?:
""
val
shareUrl
=
arguments
?.
getString
(
KEY_SHARE_URL
)
?:
""
val
shareUrl
=
arguments
?.
getString
(
KEY_SHARE_URL
)
?:
""
val
shareMiniId
=
arguments
?.
getString
(
KEY_SHARE_MINI_ID
)
?:
""
val
shareMiniPath
=
arguments
?.
getString
(
KEY_SHARE_MINI_PATH
)
?:
""
ivSharePicture
=
view
?.
findViewById
(
R
.
id
.
iv_share_picture
)
ivSharePicture
=
view
?.
findViewById
(
R
.
id
.
iv_share_picture
)
...
@@ -82,13 +84,15 @@ class ShareMeditationDialog : DialogFragment() {
...
@@ -82,13 +84,15 @@ class ShareMeditationDialog : DialogFragment() {
llQQFriend
=
view
?.
findViewById
(
R
.
id
.
ll_qq_friend
)
llQQFriend
=
view
?.
findViewById
(
R
.
id
.
ll_qq_friend
)
llWeChat
?.
setOnClickListener
{
llWeChat
?.
setOnClickListener
{
ShareUtils
.
shareTo
(
ShareUtils
.
shareSmailWeixin
(
SHARE_MEDIA
.
WEIXIN
,
activity
as
Activity
,
activity
as
Activity
,
shareTitle
,
shareTitle
,
shareUrl
,
shareUrl
,
shareContent
,
shareContent
,
shareImageUrl
shareImageUrl
,
path
=
shareMiniPath
,
id
=
shareMiniId
,
shareListener
=
null
)
)
dismiss
()
dismiss
()
}
}
...
@@ -147,13 +151,24 @@ class ShareMeditationDialog : DialogFragment() {
...
@@ -147,13 +151,24 @@ class ShareMeditationDialog : DialogFragment() {
private
const
val
KEY_SHARE_URL
=
"key_share_url"
private
const
val
KEY_SHARE_URL
=
"key_share_url"
private
const
val
KEY_SHARE_CONTENT
=
"key_share_content"
private
const
val
KEY_SHARE_CONTENT
=
"key_share_content"
private
const
val
KEY_SHARE_IMAGE_URL
=
"key_share_image_url"
private
const
val
KEY_SHARE_IMAGE_URL
=
"key_share_image_url"
private
const
val
KEY_SHARE_MINI_ID
=
"key_share_mini_id"
fun
newInstance
(
shareTitle
:
String
,
shareUrl
:
String
,
shareContent
:
String
,
shareImageUrl
:
String
):
ShareMeditationDialog
{
private
const
val
KEY_SHARE_MINI_PATH
=
"key_share_mini_path"
fun
newInstance
(
shareTitle
:
String
,
shareUrl
:
String
,
shareContent
:
String
,
shareImageUrl
:
String
,
miniId
:
String
,
miniPath
:
String
):
ShareMeditationDialog
{
val
args
=
Bundle
()
val
args
=
Bundle
()
args
.
putString
(
KEY_SHARE_TITLE
,
shareTitle
)
args
.
putString
(
KEY_SHARE_TITLE
,
shareTitle
)
args
.
putString
(
KEY_SHARE_CONTENT
,
shareContent
)
args
.
putString
(
KEY_SHARE_CONTENT
,
shareContent
)
args
.
putString
(
KEY_SHARE_URL
,
shareUrl
)
args
.
putString
(
KEY_SHARE_URL
,
shareUrl
)
args
.
putString
(
KEY_SHARE_IMAGE_URL
,
shareImageUrl
)
args
.
putString
(
KEY_SHARE_IMAGE_URL
,
shareImageUrl
)
args
.
putString
(
KEY_SHARE_MINI_ID
,
miniId
)
args
.
putString
(
KEY_SHARE_MINI_PATH
,
miniPath
)
val
fragment
=
ShareMeditationDialog
()
val
fragment
=
ShareMeditationDialog
()
fragment
.
arguments
=
args
fragment
.
arguments
=
args
return
fragment
return
fragment
...
...
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