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

Scene Graph Video - Multiple Streams

Hi! How can i pass multiple video streams to the Scene Graph Video? Or if i can't, what should i do to play a video with the quality depending on user's network connection?
Thanks!
- Gabriel
0 Kudos
2 REPLIES 2
RokuJoel
Binge Watcher

Re: Scene Graph Video - Multiple Streams

Hi Gabriel,

If you are playing mp4 files, you would hand the video node an array of streams. This on the Content Metadata page in our docs:


Video={}
Video.streams=[{url : "http://me.com/x-384.mp4"
                      bitrate : 384
                      quality : false
                      contentid : "x-384"}
               {url : "http://me.com/x-2500.mp4"
                       bitrate : 2500
                      quality : true
                      contentid : "x-1500"}
               {url : "http://me.com/x-5000.mp4"
                       bitrate : 5000
                      quality : true
                      contentid : "x-5000"}]


If you are playing HLS or another similar format, you generally hand the player the Master Playlist file containing each of the bitrate variant streams, along with a switching strategy.


Video={}
video.streamFormat="hls"
video.Switching_Strategy="full-adaptation"
Video.streams=[{url : "http://me.com/live/master_playlist.m3u8"
                      bitrate : 0
                      quality : false}]





Hope that helps,

 - Joel
0 Kudos
zig_zag
Visitor

Re: Scene Graph Video - Multiple Streams

Hi Joel!

This is exactly what i need. I found it in the documentation but when i saw this:
"Used by roVideoPlayer and roVideoScreen to specify the content metadata for a set of fixed bitrate streams. Each array item specifies the URL, bitrate, etc. for one stream variant."

i thought that it's not available for SG Video.

Thank you and have a good day!!
- Gabriel
0 Kudos