Yep, i stopped video with "back button".
After stop video i return to "roSpringboardScreen", this stop working correctly: OK button and play again with press msg.isButtonPressed() --> and msg.GetIndex() = 1 not work and return
Unexpected event type: 15
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roSpringboardScreenEvent" then
if msg.isScreenClosed()
print "Screen closed"
exit while
else if msg.isRemoteKeyPressed()
'DISABLE LEFT/RIGHT Poster Detail change
'print "Remote key pressed"
'if msg.GetIndex() = remoteKeyLeft then
' showIndex = UI_getPrevShow(showList, showIndex)
' if showIndex <> -1
' UI_refreshShowDetail(screen, showList, showIndex)
' end if
' else if msg.GetIndex() = remoteKeyRight
' showIndex = UI_getNextShow(showList, showIndex)
' if showIndex <> -1
' UI_refreshShowDetail(screen, showList, showIndex)
' end if
'endif
else if msg.isButtonPressed()
print "ButtonPressed"
if msg.GetIndex() = 1 'watch
episode = CreateObject("roAssociativeArray")
episode.Stream = {
url:"http://techslides.com/demos/sample-videos/small.mp4",
bitrate:2000
quality:false
streamType: "mp4" ' change to ism
contentid:"1"
}
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
screen.SetMessagePort(port)
screen.SetPositionNotificationPeriod(30)
screen.SetContent(episode)
screen.Show()
endif
if msg.GetIndex() = 2 'add playlist
endif
if msg.GetIndex() = 3 'add fav
endif
if msg.GetIndex() = 4 'disabled
endif
if msg.GetIndex() = 5 'add fav
return -1 'delete current screen and not break OK button
endif
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
end if
else
print "Unexpected message class: "; type(msg)
end if
end while
Regards,
Patryk Rzucidlo (PTKDev)
Find me on social, forum and app with nickname "PTKDev".
Portfolio: http://www.ptkdev.it
Skype: ptkdev | Twitter: @ptkdev | LinkedIN: ptkdev | CurriculumVitae: http://cv.ptkdev.it