埋点 - video播放暂停
This commit is contained in:
parent
6c858ca0d7
commit
af87e4da5d
|
|
@ -17,6 +17,7 @@ import androidx.core.view.isVisible
|
||||||
import com.ama.core.architecture.appBase.AppViewsEmptyViewModelFragment
|
import com.ama.core.architecture.appBase.AppViewsEmptyViewModelFragment
|
||||||
import com.ama.core.architecture.util.AndroidUtil
|
import com.ama.core.architecture.util.AndroidUtil
|
||||||
import com.ama.core.architecture.util.setOnClickBatch
|
import com.ama.core.architecture.util.setOnClickBatch
|
||||||
|
import com.gamedog.vididin.StatisticUtil
|
||||||
import com.viddin.videos.free.R
|
import com.viddin.videos.free.R
|
||||||
import com.gamedog.vididin.beans.YoutubeVideo
|
import com.gamedog.vididin.beans.YoutubeVideo
|
||||||
import com.gamedog.vididin.widget.MyPlayerControlView
|
import com.gamedog.vididin.widget.MyPlayerControlView
|
||||||
|
|
@ -179,6 +180,17 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun sendPlayStopStatistic(isPlayStart: Boolean) {
|
||||||
|
mVideoData?.let {
|
||||||
|
StatisticUtil.reportEvents(if (isPlayStart) StatisticUtil.KEY_Video_Play_Start else StatisticUtil.KEY_Video_Play_End,
|
||||||
|
mapOf(
|
||||||
|
"video_id" to it.id,
|
||||||
|
"watch_duration" to mCurPlayedSecond.toInt(), //Second
|
||||||
|
"is_completed" to (Math.abs(mTotalDuration - mCurPlayedSecond) < 2),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun generateThumbAndSet() {
|
private fun generateThumbAndSet() {
|
||||||
// capturePlayerView And Show as thumb
|
// capturePlayerView And Show as thumb
|
||||||
|
|
@ -215,6 +227,8 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mIsPlaying) mTickerTimer.start() else mTickerTimer.pause()
|
if (mIsPlaying) mTickerTimer.start() else mTickerTimer.pause()
|
||||||
|
|
||||||
|
sendPlayStopStatistic(mIsPlaying)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue