Skip to content

Commit 8500888

Browse files
authored
Watch Time Fix (#83)
* added time delta check for updating content playback time * changed time delta number
1 parent 84a09fa commit 8500888

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/mux-analytics.brs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,14 @@ function muxAnalytics() as Object
11201120
if m.video_state <> "playing" then return
11211121
if m._contentPlaybackTime = Invalid then return
11221122

1123-
m._contentPlaybackTime = m._contentPlaybackTime + ((m._playerPlayheadTime - m._Flag_lastReportedPosition) * 1000)
1123+
timeDelta = m._playerPlayheadTime - m._Flag_lastReportedPosition
1124+
1125+
' Guard against suspiciously large jumps
1126+
if timeDelta > 100 then
1127+
return
1128+
end if
1129+
1130+
m._contentPlaybackTime = m._contentPlaybackTime + (timeDelta * 1000)
11241131
end sub
11251132

11261133
prototype._updateTotalWatchTime = sub()

0 commit comments

Comments
 (0)