【埋点】视频开始播放事件中上报了观看时长和是否完整播放的属性,这个时候刚开始观看不能上报

This commit is contained in:
renhaoting 2026-01-22 11:01:16 +08:00
parent 93f1cf9921
commit 55c79e7d7e
1 changed files with 13 additions and 6 deletions

View File

@ -189,12 +189,19 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
private fun sendPlayStopStatistic(isPlayStart: Boolean) { private fun sendPlayStopStatistic(isPlayStart: Boolean) {
mVideoData?.let { mVideoData?.let {
StatisticUtil.reportEvents(if (isPlayStart) StatisticUtil.KEY_Video_Play_Start else StatisticUtil.KEY_Video_Play_End, if (isPlayStart) {
mapOf( StatisticUtil.reportEvents(StatisticUtil.KEY_Video_Play_Start,
"video_id" to it.id, mapOf(
"watch_duration" to mCurPlayedSecond.toInt(), //Second "video_id" to it.id
"is_completed" to (mCurPlayedSecond>= mTotalDuration || Math.abs(mTotalDuration - mCurPlayedSecond) < 2), ))
)) } else {
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 (mCurPlayedSecond>= mTotalDuration || Math.abs(mTotalDuration - mCurPlayedSecond) < 2),
))
}
} }
} }