Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
jamilou
Level 7

Help needed with StreambiteRates

Hello,

I'm using the following code to watch my live streams and they take at least 5 secondes to buffer and stream. I would like them to start immediatly without buffering. When I use them with VLC they start immediatly.
I tried to find how to add the StreamBiteRates to my code but I can't figure it out. 
Here's my XML code : 

<!-- main node which handles the screen -->
<component name="MainScene" extends="Scene">

  <children>
  <!-- video -->
    <Video
      id="Video"
      visible="true"
      width="1920"
      height="1080"
      translation="[0,0]"/>

    <!-- menu -->
    <LabelList
      id="MenuList"
      translation="[100,50]"
      itemSize="[600,100]"
      visible="false">
      <ContentNode id="menucontent" role="content">
        

<ContentNode title="Islande 1" url="http://huq.opdtv.il/iptv/ch1?code=1753" description="TS" />



And here's my BRS file : 
' ********** Copyright 2016 Roku Corp.  All Rights Reserved. **********

'Main Scene Initialization with menu and video.
sub init()
      m.player = m.top.FindNode("Video")
      m.list = m.top.FindNode("MenuList")
      m.player.setFocus(true)

  'Set the initial video player to some content'
  content = CreateObject("roSGNode", "ContentNode")
  content.url = "http://hlslive.lcdn.une.net.co:80/v1/AUTH_HLSLIVE/TV5/tu1_manifest.m3u8"
  content.streamformat = "hls"
  m.itemfocused = 0
  m.player.content = content
  'Tell the video player to play the content'
  m.player.control = "play"
end sub

'Handle remote control key presses'
function onKeyEvent(key as String, press as Boolean) as boolean
  print key + ":" ; press
  if press
    if key = "OK"
      print m.list.visible
      print m.list.itemfocused
      print m.itemfocused
      if m.list.ItemFocused = m.itemfocused and m.list.visible = true
        m.list.visible = false
        m.player.setfocus(true)
      else if m.list.visible = false
        m.list.visible = true
      else if m.list.visible = true
        m.itemfocused = m.list.itemfocused
        m.player.visible = false
        m.player.control = "stop"
        selectedContent = m.list.content.getChild(m.list.itemfocused)
        content = CreateObject("roSGNode", "ContentNode")
        content.url = selectedContent.url
        content.streamformat = selectedContent.description
        m.player.content = content
        m.player.visible = true
        m.player.control = "play"
      end if
    else if key = "play"
      if m.player.control = "pause"
        m.player.control = "resume"
      else
        m.player.control = "pause"
      end if
    else if key = "back"
      if m.list.visible = true
        m.list.visible = false
        m.player.setfocus(true)
        return true
      else
        m.list.visible = true
        m.list.setfocus(true)
        return true
      end if
    else
      print key
    end if
  else
    m.list.setfocus(true)
  end if
end function


Thank you very much guys
0 Kudos
1 Reply
jamilou
Level 7

Re: Help needed with StreambiteRates

Anyone ? I have no clue how to code but I'm trying to. This channel is for my personnal use.
Please need your help.

Thank you
0 Kudos