Fredfs
7 months agoNewbie
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>
```