Sub Main()
initTheme()
screenFacade = CreateObject("roPosterScreen")
screenFacade.show()
item = { ContentType:"episode"
SDPosterUrl:"file://pkg:/images/img-islamchannel-logo.png"
HDPosterUrl:"file://pkg:/images/img-islamchannel-logo.png"
IsHD:False
HDBranded:False
ShortDescriptionLine1:"Islam Channel"
ShortDescriptionLine2:""
Description:""
Rating:"NR"
StarRating:"80"
Length:1280
Categories:["Technology","Talk"]
Title:"Islam Channel"}
showSpringboardScreen(item)
screenFacade.showMessage("")
sleep(25)
End Sub
'Sub initTheme()
app = CreateObject("roAppManager")
theme = CreateObject("roAssociativeArray")
theme.OverhangPrimaryLogoOffsetSD_X = "72"
theme.OverhangPrimaryLogoOffsetSD_Y = "15"
theme.OverhangSliceSD = "pkg:/images/Overhang_BackgroundSlice_SD43.png"
theme.OverhangPrimaryLogoSD = "pkg:/images/Logo_Overhang_SD43.png"
theme.OverhangPrimaryLogoOffsetHD_X = "123"
theme.OverhangPrimaryLogoOffsetHD_Y = "20"
theme.OverhangSliceHD = "pkg:/images/Overhang_BackgroundSlice_HD.png"
theme.OverhangPrimaryLogoHD = "pkg:/images/Logo_Overhang_HD.png"
app.SetTheme(theme)
End Sub
Function showSpringboardScreen(item as object) As Boolean
port = CreateObject("roMessagePort")
screen = CreateObject("roSpringboardScreen")
print "showSpringboardScreen"
screen.SetMessagePort(port)
screen.AllowUpdates(false)
if item <> invalid and type(item) = "roAssociativeArray"
screen.SetContent(item)
endif
screen.SetDescriptionStyle("generic") 'audio, movie, video, generic
' generic+episode=4x3,
screen.ClearButtons()
screen.AddButton(1,"Play")
screen.AddButton(2,"Go Back")
screen.SetStaticRatingEnabled(false)
screen.AllowUpdates(true)
screen.Show()
downKey=3
selectKey=6
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roSpringboardScreenEvent"
if msg.isScreenClosed()
print "Screen closed"
exit while
else if msg.isButtonPressed()
print "Data: ";msg.GetData()
if msg.GetIndex() = 1
print "Button pressed: Play"
displayVideo()
else if msg.GetIndex() = 2
print "Button pressed: Go Back"
return true
endif
else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
else
print "wrong type.... type=";msg.GetType(); " msg: "; msg.GetMessage()
endif
end while
return true
End Function
Function displayVideo()
print "Displaying video... "
p = CreateObject("roMessagePort")
video = CreateObject("roVideoScreen")
video.setMessagePort(p)
videoclip = CreateObject("roAssociativeArray")
videoclip.StreamUrls = ["http://92.48.78.127/ibcomtest/test.mp4"]
videoclip.StreamBitrates = [252]
videoclip.StreamQualities = ["SD"]
videoclip.StreamFormat = "mp4"
videoclip.Live = False
videoclip.HDBranded = False
videoclip.Title = "islam channel test"
video.SetContent(videoclip)
video.show()
lastSavedPos = 0
statusInterval = 10 'position must change by more than this number of seconds before saving
while true
msg = wait(0, video.GetMessagePort())
if type(msg) = "roVideoScreenEvent"
if msg.isScreenClosed() then 'ScreenClosed event
print "Closing video screen"
exit while
else if msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
if nowpos > 10000
end if
if nowpos > 0
if abs(nowpos - lastSavedPos) > statusInterval
lastSavedPos = nowpos
end if
end if
else if msg.isRequestFailed()
print "play failed: error_no = ";msg.GetData();" error_msg = "; msg.GetMessage()
else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
end if
end while
End Function
#EXTM3U
#EXT-X-TARGETDURATION:60,Test
#EXTINF:60,
http://192.168.1.102/test.ts
#EXT-X-ENDLIST
"RokuMarkn" wrote:
renojim, I'm not sure if this is the whole issue, but there is an error in your m3u8 syntax. The EXT-X-TARGETDURATION line should have only one parameter. See if it works better if you remove the ",Test" at the end of the line.
--Mark