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: 
AbhiK
Streaming Star

Roku Video Player shows black screen while buffering the content

I want to handle video player Black screen which comes during buffering the video, I want to pause the video while it is about to start buffering, I trying but not able to do so Please help me out from this situation any kind of help would be helpful.

Thanks

0 Kudos
4 REPLIES 4
chaklasiyanikun
Roku Guru

Re: Roku Video Player shows black screen while buffering the content

This question is required more detail. I think you try, when video state change to buffering then you try to paused video. correct?.

0 Kudos
AbhiK
Streaming Star

Re: Roku Video Player shows black screen while buffering the content

Actually, I want to display the video frame (of the point when video player started buffering) with a loader on it while video player is buffering, instead of showing a black screen in the background of a loader.
Is there any way to do so?

0 Kudos
chaklasiyanikun
Roku Guru

Re: Roku Video Player shows black screen while buffering the content

No such method has been provided by Roku. But, you can make this possible in your way.

Example :

I take a small example in a video player. Please, put the below code in an XML file.

<Video id="video_node_ID" height="720" width="1280"
translation="[0,0]" visible="false" />
<LayoutGroup translation="[640,360]"
horizAlignment="center" vertAlignment="center">
         <BusySpinner id="spin" clockwise="true" spinInterval="2" />
</LayoutGroup>

And Also, Put below code in your .brs file

sub init()
     m.video = m.top.findNode("video_node_ID")
     m.video.observeField("state", "stateChanged")
     m.spin = m.top.findNode("spin")
     m.spin.visible = false
     m.spin.uri = "pkg:/images/loader.png"
end sub
function stateChanged()
     ?"m.video.state : " m.video.state 
     if m.video.state = "playing"
         ?"playback handling!"
         m.video.visible = true
         m.spin.control = "stop"
         m.spin.visible = false
         ?"playback handling Closed!" 
         handled = true
     else if m.video.state = "buffering"
         ?"buffering handling!"
         m.video.visible = false
         m.spin.control = "start"
         m.spin.visible = true
         ?"buffering handling Closed!" 
         handled = true
     end if
return handled 
end function

Using these codes you able to show loader instead of the black screen. I hope this is helpful to you.

AbhiK
Streaming Star

Re: Roku Video Player shows black screen while buffering the content

Thanks for reply,
but this is not what we are searching for, Actually we want to show video frame should pause prior to buffering. and when we start video  it will play next frame of video.

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.