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
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
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
"sparkerman" wrote:
what does your playlist look like?
"ishish" wrote:
I've found a workaround for the current Firmware in case others need it:
1. Extend the video scenegraph component and put the onkeyEvent on that extended component
2. Check for press=true right and left events and then set the m.top.nextContentIndex value and m.top.control="skipcontent"
3. Make sure to return handled=true when you do this so it doesn't pass the event up the event chain
This seems to work. There seems to be a bug though when setting the nextContentIndex to a previous video in the playlist you have to set m.top.control = "play" not m.top.control="skipcontent". When setting nextContentIndex to a playlist >= current contentIndex m.top.control="skipcontent" works.
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
Thanks for your patience — we’re excited to share what’s next!