修复视频播放数量不更新的问题
This commit is contained in:
@@ -188,6 +188,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
// 播放结束自动下一条
|
||||
player.addEventListener('ended', () => { next(); });
|
||||
|
||||
let lastLoggedVideo = '';
|
||||
player.addEventListener('play', () => {
|
||||
const cur = player.currentSrc || player.src || '';
|
||||
if (!cur || cur === lastLoggedVideo) return;
|
||||
lastLoggedVideo = cur;
|
||||
track({ event: 'video_play', page: location.pathname, url: cur, title: '' });
|
||||
});
|
||||
|
||||
// 从后端接口获取视频列表
|
||||
// 初始化:先拉取首条并填充缓存
|
||||
(async () => {
|
||||
|
||||
Reference in New Issue
Block a user