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: 
campbellwang
Visitor

Re: HTTP Live Streaming Now Available For Developers

"RokuMarkn" wrote:
campbellwang, from the logs it looks like you may be setting the StreamFormat to "mp4" rather than "hls". Can you check that, and if you think that's not the issue, please post or PM me the code you're using to create your VideoScreen.

--Mark


Okay, I will need to get back to you tomorrow then. Thanks
CDNOne.com | CDNTwo.com
0 Kudos
PRIZM
Visitor

Re: HTTP Live Streaming Now Available For Developers

i will try this Mark I will let you know in a min...

"RokuMarkn" wrote:
campbellwang, from the logs it looks like you may be setting the StreamFormat to "mp4" rather than "hls". Can you check that, and if you think that's not the issue, please post or PM me the code you're using to create your VideoScreen.

--Mark
0 Kudos
PRIZM
Visitor

Re: HTTP Live Streaming Now Available For Developers

Tried like this <streamFormat>mp4</streamFormat> and still got the progress bar starting to load then back to springboard,. Hmmm...
0 Kudos
PRIZM
Visitor

Re: HTTP Live Streaming Now Available For Developers

Oops Sorry <streamFormat>hls</streamFormat>

"PRIZM" wrote:
Tried like this <streamFormat>mp4</streamFormat> and still got the progress bar starting to load then back to springboard,. Hmmm...
0 Kudos
PRIZM
Visitor

Re: HTTP Live Streaming Now Available For Developers

This is my appVideoScreen.brs that I am using:

Function showVideoScreen(episode As Object)

if type(episode) <> "roAssociativeArray" then
print "invalid data passed to showVideoScreen"
return -1
endif

port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
screen.SetMessagePort(port)

screen.Show()
screen.SetContent(episode)
screen.Show()

'Uncomment his line to dump the contents of the episode to be played
'PrintAA(episode)

while true
msg = wait(0, port)

if type(msg) = "roVideoScreenEvent" then
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
elseif msg.isRequestFailed()
print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
else
print "Unexpected event type: "; msg.GetType()
end if
else
print "Unexpected message class: "; type(msg)
end if
end while

End Function
0 Kudos
RokuMarkn
Visitor

Re: HTTP Live Streaming Now Available For Developers

The important thing is what is in your episode object. You must set episode.StreamFormat = "hls".

For a working example using your URL, you can modify the SimpleVideoPlayer example like this:

1. Edit appMain.brs and change the line
videoclip.StreamFormat = "mp4"
to
videoclip.StreamFormat = "hls"

2. Change the line
urls = ["http://video.ted.com/talks/podcast/DanGilbert_2004_480.mp4"]
to
urls = ["http://iphoned5.akamai.com.edgesuite.net/mhbarron/nasatv/nasatv_all.m3u8"]

3. Rebuild the zip file and install it on your Roku box.

--Mark
0 Kudos
PRIZM
Visitor

Re: HTTP Live Streaming Now Available For Developers

Im basing this off of the videoplayer example by using an XML would this still apply the same way or how would it be passed to the roVideoScreen object from the XML????

"RokuMarkn" wrote:
The important thing is what is in your episode object. You must set episode.StreamFormat = "hls".

For a working example using your URL, you can modify the SimpleVideoPlayer example like this:

1. Edit appMain.brs and change the line
videoclip.StreamFormat = "mp4"
to
videoclip.StreamFormat = "hls"

2. Change the line
urls = ["http://video.ted.com/talks/podcast/DanGilbert_2004_480.mp4"]
to
urls = ["http://iphoned5.akamai.com.edgesuite.net/mhbarron/nasatv/nasatv_all.m3u8"]

3. Rebuild the zip file and install it on your Roku box.

--Mark
0 Kudos
Anonymous
Visitor

Re: HTTP Live Streaming Now Available For Developers

It would work the same way, but you've got to parse the XML, pull out the relevant fields and set up the roAssociativeArray for the video player.

"PRIZM" wrote:
Im basing this off of the videoplayer example by using an XML would this still apply the same way or how would it be passed to the roVideoScreen object from the XML????

"RokuMarkn" wrote:
The important thing is what is in your episode object. You must set episode.StreamFormat = "hls".

For a working example using your URL, you can modify the SimpleVideoPlayer example like this:

1. Edit appMain.brs and change the line
videoclip.StreamFormat = "mp4"
to
videoclip.StreamFormat = "hls"

2. Change the line
urls = ["http://video.ted.com/talks/podcast/DanGilbert_2004_480.mp4"]
to
urls = ["http://iphoned5.akamai.com.edgesuite.net/mhbarron/nasatv/nasatv_all.m3u8"]

3. Rebuild the zip file and install it on your Roku box.

--Mark
0 Kudos
PRIZM
Visitor

Re: HTTP Live Streaming Now Available For Developers

Could you show me by chance how thats done? Im a little lost on that one?

"RokuPatrick" wrote:
It would work the same way, but you've got to parse the XML, pull out the relevant fields and set up the roAssociativeArray for the video player.

"PRIZM" wrote:
Im basing this off of the videoplayer example by using an XML would this still apply the same way or how would it be passed to the roVideoScreen object from the XML????

"RokuMarkn" wrote:
The important thing is what is in your episode object. You must set episode.StreamFormat = "hls".

For a working example using your URL, you can modify the SimpleVideoPlayer example like this:

1. Edit appMain.brs and change the line
videoclip.StreamFormat = "mp4"
to
videoclip.StreamFormat = "hls"

2. Change the line
urls = ["http://video.ted.com/talks/podcast/DanGilbert_2004_480.mp4"]
to
urls = ["http://iphoned5.akamai.com.edgesuite.net/mhbarron/nasatv/nasatv_all.m3u8"]

3. Rebuild the zip file and install it on your Roku box.

--Mark
0 Kudos
RokuDaveW
Visitor

Re: HTTP Live Streaming Now Available For Developers

It looks like there's a bug in the videoplayer sample application. The StreamFormat should not be an array element in the XML. To work around this add the following line immediately before the call to SetContent() in appVideoScreen.brs.

To use the value that was passed in the XML data:
episode.StreamFormat = episode.StreamFormats[0]

--or--

To force it to use HLS for everything:
episode.StreamFormat = "hls"

I haven't had a chance verify this first hand, but code inspection seems to show what's wrong here. We'll fix this defect in the next release.
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.