jamilou
Visitor

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
Tags (1)
0 Kudos
1 REPLY 1
jamilou
Visitor

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
Tags (1)
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!