This is covered in the object reference. You can't read the current status as you describe, but you can listen for messages from the video object.
current_status="empty"
p = createobject("roMessagePort")
v = createobject("roVideoPlayer")
v.SetPort(p)
Now, when I set some video to play, messages will be sent to p indicating if the video is playing, and when the video has ended. So, I can listen in this way, and store the last message I received.
msg = wait(0,p)
Now, we're listening to p. The zero means we wait indefinitely. But, you could do:
msg = wait(3000,p)
So, now you would wait 3 seconds for a message, and then move on to do something else.
When a message is received, then the script moves on to the next line. You can check the message in this manner:
if type(msg) = "roVideoEvent" then
if msg.GetInt() = 3 then print "video is playing"
if msg.GetInt() = 8 then print "video has ended"
endif
Depending on the length of the video, you might only get one video event 3 to say the video is playing. Video event 8 always occurs at the end of the video. To get a video event, you can't set the loop mode to true.
v.SetLoopMode(true)
If you used this line, no video events would be reported. The video would just loop automatically when it reached the end.
0
Brian2
Thanks Lyndon,
It would be a nice feature to include in a future update to be able to ask the roVideoPlayer what it's current status is. Even better if it reported back the status and the number of elapsed seconds seconds if "Playing"
My original query was fixed by the release of firmware 3.2.40
Firmware 3.1.7 has a glitch playing MP3. After playing for 4 or 5 hours, not looped but waiting for message 8 "END" and then play next, the roAudio player would stop playing. Last message from roAudio was a 3 "Playing".
If a subsequent "play mp3" was sent in this state the HD810 would lock up requiring a reboot. (this was forced using BrightScript Debugger)
As I said the release of 3.2.40 has fixed this glitch. The 20 installed HD810 have now been playing for 5 days without stopping.
0
atprf
Lyndon and company,
Reopening an old question...
Has there (in firmware released since the original question was asked) been developed any way to poll the current playback status of an roVideoPlayer?
I am well familiar with watching for message 8, and the real reason to poll for current playback status is that I am responding to reports that message 8's occasionally do not get fired at end of file, causing an attraction reliant upon end-of-file to hang, and I have been asked to develop a watchdog mechanism.
Thank you.
0
RokuLyndon
No, no such mechanism is in place.
I don't know the cause of the problem in your case, but in the past, if a file always failed to send the video end signal, then the problem was with the video itself, normally incorrect timestamps, or an audio layer that wasn't the same size as the video layer.
If there are files or playlists where this issue can be seen regularly, that will help identify the cause.