From af87e4da5d3f4edffb910b38ba12a32a116f75c8 Mon Sep 17 00:00:00 2001 From: renhaoting <370797079@qq.com> Date: Mon, 5 Jan 2026 13:35:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=8B=E7=82=B9=20-=20video=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=9A=82=E5=81=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragments/home/fragment/HomeItemFragment.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/main/java/com/gamedog/vididin/main/fragments/home/fragment/HomeItemFragment.kt b/app/src/main/java/com/gamedog/vididin/main/fragments/home/fragment/HomeItemFragment.kt index 06858cf..5a2ffee 100644 --- a/app/src/main/java/com/gamedog/vididin/main/fragments/home/fragment/HomeItemFragment.kt +++ b/app/src/main/java/com/gamedog/vididin/main/fragments/home/fragment/HomeItemFragment.kt @@ -17,6 +17,7 @@ import androidx.core.view.isVisible import com.ama.core.architecture.appBase.AppViewsEmptyViewModelFragment import com.ama.core.architecture.util.AndroidUtil import com.ama.core.architecture.util.setOnClickBatch +import com.gamedog.vididin.StatisticUtil import com.viddin.videos.free.R import com.gamedog.vididin.beans.YoutubeVideo import com.gamedog.vididin.widget.MyPlayerControlView @@ -179,6 +180,17 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment() { }) } + 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() { // capturePlayerView And Show as thumb @@ -215,6 +227,8 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment() { } if (mIsPlaying) mTickerTimer.start() else mTickerTimer.pause() + + sendPlayStopStatistic(mIsPlaying) } }