Skip to content

Commit

Permalink
don't divide by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Jul 25, 2024
1 parent 8a15bf8 commit b6408b5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/video/VideoPlayerView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,12 @@ end sub

' When Video Player state changes
sub onPositionChanged()

' Pass video position data into OSD
m.osd.progressPercentage = m.top.position / m.top.duration
if m.top.duration = 0
m.osd.progressPercentage = 0
else
m.osd.progressPercentage = m.top.position / m.top.duration
end if
m.osd.positionTime = m.top.position
m.osd.remainingPositionTime = m.top.duration - m.top.position

Expand Down

0 comments on commit b6408b5

Please sign in to comment.