Prevent playback after duration of video

This commit is contained in:
thomabx 2020-02-17 17:08:51 -08:00
parent dcc067f11a
commit 5f0513b12f
2 changed files with 7 additions and 0 deletions

View File

@ -267,6 +267,12 @@ sub Main()
wipe_groups() wipe_groups()
goto app_start goto app_start
end if end if
else if isNodeEvent(msg, "position")
video = msg.getRoSGNode()
if video.position >= video.duration then
video.control = "stop"
video.state = "finished"
end if
else if isNodeEvent(msg, "fire") else if isNodeEvent(msg, "fire")
ReportPlayback(group, "update") ReportPlayback(group, "update")
else if isNodeEvent(msg, "state") else if isNodeEvent(msg, "state")

View File

@ -348,6 +348,7 @@ function CreateVideoPlayerGroup(video_id)
video.observeField("backPressed", m.port) video.observeField("backPressed", m.port)
video.observeField("state", m.port) video.observeField("state", m.port)
video.observeField("position", m.port)
timer.control = "start" timer.control = "start"
timer.observeField("fire", m.port) timer.observeField("fire", m.port)