Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
malik
Visitor

wmv live play back

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
0 Kudos
3 REPLIES 3
RokuMarkn
Visitor

Re: wmv live play back

The Roku DVP supports playing WMV files, but not live WMV streams. By setting StreamFormat to "wmv" you are saying that the file at http://webcast2.islamchannel.tv/islamvideo is an WMV file, but it is not.

--Mark
0 Kudos
malik
Visitor

Re: wmv live play back

That's not good news. Is there any plan for future support for wmv live or is it totally out of scope? If it is within time line can you comment on the schedule date and possible availability of a test firmware for it? What about H264 live?
0 Kudos
Anonymous
Visitor

Re: wmv live play back

Hi Malik,

WMV Live support isn't something you should expect in the short term. However, we will have live H264 streaming very soon. We are implementing HTTP Live Streaming (HLS) as defined here:


When we roll it out, it will be as simple to implement as specifying the stream type "hls" and using the URL to the appropriate m3u8 file.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.