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: 
matrixebiz
Roku Guru

Reprocess Function on Video playback failed error

Hello, using the Brightscript channel here : https://github.com/belltown/Roku-NewVideoPlayer
My video feeds are called VIA an XML file from the main.brs file like below;

<item sdImg="pkg:/images/SD/pic.png" hdImg="pkg:/images/HD/pic.png">
            <title>Video</title>
            <description></description>
            <streamFormat>hls</streamFormat>
            <switchingStrategy>full-adaptation</switchingStrategy>
            <media>
                <streamQuality>HD</streamQuality>
                <streamBitrate>0</streamBitrate>
                <userAgent>http-user-agent=iPad</userAgent>
                <streamUrl>http://www.server.com/playlist.m3u8</streamUrl>
            </media>
            <synopsis></synopsis>
            <genres></genres>
            <hash>http://www.server.com/hashfile</hash>
            <live>True</live>
</item> 


now, if you look at the item code above, I have an extra line <hash>http://www.server.com/hashfile</hash> which I have some code in RokuFeed.brs processing this security ID hash item.hash in the "Function parseRokuItem" section and adding the result to the end of the stream.url which the roku then plays the stream just fine. This hash expires after some time and I get a Video Playback Failed error because the code is not valid anymore so how can I get the roku to go back to my function in rokufeed.brs explained above to reprocess the <hash>http://www.server.com/hashfile</hash> code and start playing the new stream.url again automatically until hash expires again then repeat the loop again until manually stopped?

Thank you
0 Kudos