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: 
SolveLLC
Visitor

Switching StreamFormats on 3.0 - build 2227

We have an application that sets StreamFormat to "mp4" and immediately sets StreamFormat to "hls" and plays a second video. It's 50/50 on whether the second hls video will exit with "msg = An unexpected problem (but not server timeout or HTTP error) has been detected. | index = -3". The rest of the time the video plays as expected.

It would appear that *sometimes" the StreamFormat is not set to hls after the mp4 plays.

This works correctly in 2.9 and on the Roku2 but not in 3.0.

Any ideas?
0 Kudos
2 REPLIES 2
TheEndless
Channel Surfer

Re: Switching StreamFormats on 3.0 - build 2227

I don't know if it will help, but I have found that 3.0 requires a Sleep() to be added in some cases when playing videos back to back in order for the video screen to fully close before opening the new one. That might be what you're seeing. Try adding a very short sleep (like 50ms) after playback ends to see if it helps.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
SolveLLC
Visitor

Re: Switching StreamFormats on 3.0 - build 2227

Yea, I've tried that, even putting a 10000ms sleep. It just that sometimes the HLS video comes back as uninitialized, and since the Roku defaults to mp4 it fails. It's totally random, like I said, it will work 2 out of 5 times. I've even tried setting StreamFormat to "hls" again before the video begins to play, but it still fails.
0 Kudos