I have a playlist that I've set up on my video node. Things are working as expected when one video ends, the next begins with no issues. However when I set the control field on the Video Node to "skipcontent" the next video does not immediately start, I have to manually press the play button on the remote control to resume playback. Sample code:
sub startVideoPlayback()
m.video = m.top.findNode("mainVideo")
m.video.setFocus(true)
' playlist contents a ContentNode with child ContentNodes with the appropriate Content Meta-data
m.video.content = playlist
' Allows us to control the trick play bar visibility. Even the default behavior (not mucking with the trickplaybar results in the same behavior)
m.video.trickplaybarvisibilityauto=FALSE
m.video.trickplaybar.translation=[110,900]
m.video.observeField("contentIndex", "contentIndexChanged")
m.video.observeField("state", "videoStateChanged")
m.video.control = "play"
end sub
function onKeyEvent(key as String, press as Boolean) as Boolean
handled = false
if key = "right" then
? "setting m.video.control skipcontent"
m.video.control = "skipcontent"
handled = true
end if
return handled
end function
sub contentIndexChanged()
? "contentIndex: ", m.video.contentIndex, "[contentIndexChanged]"
if m.video.state = "paused"
'? "resuming video [contentIndexChanged]"
' Have tried m.video.control = "play" here as well and that does not work
m.video.control = "resume"
end if
end sub
sub videoStateChanged()
? "video state is ", m.video.state
end sub
This is what the print statements spit out either:
video state is paused
onKeyEvent [PlayerScreen] called with key right press: false
setting m.video.control skipcontent
video state is buffering
video state is buffering
contentIndex: 1 [contentIndexChanged]
contentIndex: 1 [contentIndexChanged]
video state is playing
video state is playing
video state is paused
video state is paused
Or sometimes the contentIndexChanged is not fired
video state is paused
video state is paused
onKeyEvent [PlayerScreen] called with key right press: false
setting m.video.control skipcontent
video state is buffering
video state is buffering
in either case the behavior is the same. The next video will only play if the user physically presses play on the remote.
I've tried the following, nothing works :
- in videoStateChanged I've tried setting m.video.control = "play" or m.video.control = "resume" when I'm in a buffering/paused state
- in contentIndexChanged I've tried the same (trying to force play or resume)