Skip to content

Commit 5bad5cf

Browse files
authored
Viewing Data Irregularities (#76)
* added guard for video position jump * changed video position jump value
1 parent 261b32b commit 5bad5cf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/mux-analytics.brs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function runBeaconLoop()
1515
m.POSITION_TIMER_INTERVAL = 250 '250
1616
m.SEEK_THRESHOLD = 1250 'ms jump in position before a seek is considered'
1717
m.HTTP_RETRIES = 10 'number of times to reattempt http call'
18+
m.MAX_VIDEO_POSITION_JUMP = 2000000000
1819

1920
m.pollTimer = CreateObject("roSGNode", "Timer")
2021
m.pollTimer.id = "pollTimer"
@@ -489,7 +490,9 @@ function muxAnalytics() as Object
489490
prototype.videoStateChangeHandler = sub(videoState as String)
490491
m.video_state = videoState
491492
previouslyLastReportedPosition = m._Flag_lastReportedPosition
492-
m._playerPlayheadTime = m.video.position
493+
if m.video.position < m.MAX_VIDEO_POSITION_JUMP
494+
m._playerPlayheadTime = m.video.position
495+
end if
493496
m._Flag_lastReportedPosition = m._playerPlayheadTime
494497

495498
' Need to actually infer seek all the way out here
@@ -1057,7 +1060,9 @@ function muxAnalytics() as Object
10571060
if m.video = Invalid then return
10581061
if m._Flag_isPaused = true then return
10591062

1060-
m._playerPlayheadTime = m.video.position
1063+
if m.video.position < m.MAX_VIDEO_POSITION_JUMP
1064+
m._playerPlayheadTime = m.video.position
1065+
end if
10611066

10621067
m._setBufferingMetrics()
10631068
m._updateContentPlaybackTime()

0 commit comments

Comments
 (0)