Commit 81b3ba15 by 范玉宾

meditation type error when enter playDetail from floatView

parent 1669b637
......@@ -116,9 +116,9 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
it?.start()
it?.setVolume(0.0F, 0.0F)
}
video_view?.setOnCompletionListener { video_view?.start() }
video_view?.setOnCompletionListener { video_view?.start() }
bean.mditationListResponse?.forEach {
meditationTitles.add(it.comment)
......
......@@ -21,21 +21,19 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#999999">
android:layout_height="match_parent">
<com.yidianling.home.widget.AdaptiveVideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="false"
android:focusableInTouchMode="false" />
android:focusableInTouchMode="false"/>
<!-- <ImageView-->
<!-- android:id="@+id/iv_video_background"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:scaleType="fitCenter"/>-->
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#88999999"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
......
......@@ -16,7 +16,7 @@ class MeditationPlayModuleBean : HomeItemBaseBean {
var mediaList: ArrayList<MeditationDetail>? = null
data class MeditationDetail(
val mediaType:Int? = null,
val meditationType:Int? = null,
val mediaId:Long?=null,
val meditationId:Long,
val title:String,
......
......@@ -7,4 +7,5 @@ class MeditationFloatEvent(
val stop: Boolean?=null,
val time:Long?=null,
val meditationDetail: MeditationPlayModuleBean.MeditationDetail?=null
)
\ No newline at end of file
)
......@@ -143,7 +143,6 @@ class MeditationWindowService : LifecycleService() {
}
}
}
private fun updateFloatView(meditation: MeditationPlayModuleBean.MeditationDetail) {
......@@ -155,8 +154,12 @@ class MeditationWindowService : LifecycleService() {
val intent = Intent(this, PlayMeditationActivity::class.java)
intent.putExtra("MEDIA_ID", meditation.mediaId)
intent.putExtra("MEDITATION_ID", meditation.meditationId)
intent.putExtra("MEDITATION_TYPE", meditation.mediaType)
intent.putExtra("MEDITATION_TYPE", meditation.meditationType)
intent.putExtra("MEDIA_COVER_URL", meditation.coverImageUrl)
intent.putExtra("MEDIA_URL", meditation.mediaUrl)
intent.putExtra("BROAD_CAST_TIME",
(ivProgress?.curProcess?.div(1000.00))?.roundToInt() ?: 0)
intent.flags = FLAG_ACTIVITY_NEW_TASK
startActivity(intent)
}
......@@ -279,6 +282,7 @@ class MeditationWindowService : LifecycleService() {
if (EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().unregister(this)
}
mDisposable?.dispose()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
stopForeground(true)
}
......@@ -328,7 +332,6 @@ class MeditationWindowService : LifecycleService() {
}
private fun postPlayRecord(
isQuit: Int,
playTime: Int,
......
package com.yidianling.muse.utils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.yidianling.home.http.MuseHttp
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
class MediaPlayerTimeUtil {
companion object{
......@@ -64,6 +69,29 @@ class MediaPlayerTimeUtil {
}
fun uploadPlayRecord(meditationId:Int?,mediaId:Long?,
isQuit:Int,playTime:Int,isComplete:Int){
if (meditationId != null && mediaId != null) {
MuseHttp.getInstance().postMeditationPlayRecord(
meditationId = meditationId!!.toInt(),
isQuit = isQuit, mediaId = mediaId!!,
playTime = playTime,
isComplete = isComplete
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
}, {
object : ThrowableConsumer() {
override fun accept(msg: String) {
}
}
})
}
}
}
}
\ No newline at end of file
......@@ -493,7 +493,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
jtv_test?.postDelayed({ YdlBuryPointUtil.sendClick("ClickEvent") }, 500)
} else if (id == R.id.ll_meditation) { //冥想
count(UserMyPageEvent.YDL_USER_MY_MIDDLE_TYPE_CLICK, "冥想")
val h5Params3 = H5Params(MH5_URL + "meditation?hideNavBar=1", null)
val h5Params3 = H5Params(MH5_URL + "meditation/list?hideNavBar=1", null)
NewH5Activity.start(activity, h5Params3)
}
}
......
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