unDEFER
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2021
09:41 AM
Pause on playing cycle
Hello!
By some condition I need to pause playing video just after it starts playing. My code looks like this:
function onVideoStateChanged() print "VIDEO "; m.Video.state if m.Video.state = "playing" if <some condition> print "Force pause" m.Video.control = "pause" end if end if end function
But in the log I see:
VIDEO buffering VIDEO playing Force pause VIDEO paused VIDEO playing
And video anyway plays. (I don't remember any other my code which can unpause it by itself). How to get around it?
2 REPLIES 2
AbhiK
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2021
03:57 AM
Re: Pause on playing cycle
Can you share some information about the stream you are using?
that might help while identifying the issue.
unDEFER
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2021
09:24 AM
Re: Pause on playing cycle
I did the trick by the next code:
function onVideoStateChanged() print "VIDEO "; m.Video.state if m.Video.state = "playing"
if m.ISaidPause
m.Video.control = "pause"
m.ISaidPause = false
end if
if <some condition> print "Force pause" m.Video.control = "pause"
m.ISaidPause = true end if end if end function
Where m.ISaidPause just boolean flag initialized by false.