Hi
I have given lot of tries but still fail. I package it properly i.e. files at root in zip file. Here is my script to play live wmv streaming:
Can anyone look at it to run my channel on Roku?
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 "Button pressed: "; msg.GetIndex(); " " msg.GetData()
if msg.GetIndex() = 1
displayVideo()
else if msg.GetIndex() = 2
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.StreamBitrates = [102]
videoclip.StreamUrls = ["http://webcast2.islamchannel.tv/islamvideo"]
videoclip.StreamQualities = ["SD"]
videoclip.StreamFormat = "wmv"
videoclip.Live = True
videoclip.HDBranded = False
videoclip.Title = "islam channel test4"
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: "; msg.GetMessage()
else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
end if
end while
End Function