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: 
Fredfs
Newbie

In Roku Brighscript: How to refresh a video scene if/when HSL streaming stops playing?

I have this very simple roku app, with this single video scene to play the live m3u8 stream forever. But eventually then video freezes. Is it possible to detect the video is not playing, destroy and recreate the videocontent ?
```
<?xml version = "1.0" encoding = "utf-8" ?>
<component name = "VideoExample" extends = "Scene" >
<script type = "text/brightscript" >
<![CDATA[

sub init()
videocontent = createObject("RoSGNode", "ContentNode")
videocontent.live = true
videocontent.PlayStart = 999999999
videocontent.streamformat = "hls"
videocontent.url = "my_m3u8_url"

video = m.top.findNode("exampleVideo")
video.content = videocontent

video.setFocus(true)
video.control = "play"
end sub

]]>

</script>
<children >
<Video id = "exampleVideo"/>
</children>
</component>
```

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.