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

HLS Live playback after Instant Replay or Rewind

I've got HLS Live streams which playback fine. The problems occur when a user clicks either the Instant Replay button or the Rewind button. In both cases, the playback does successfully back up a reasonable amount and resumes playback. However, the playback hangs forever once it finishes replaying those segments and the already downloaded segments, without ever continuing to download new segments.

I'm sorry about the length of the following, but it's actually not very much data (lots of similar data for a sample collection of segments).
My debug logs look good to me while the playback initially gets going:

Stream started. index: 0 data: 0
StreamBitrate: 0
MeasuredBitrate: 5830
Url: xxx
IsUnderrun: false

Download segment info index: 0 data: 0
Sequence: 0
Status: 0
SegBitrate: 3000
DownloadDuration: 1
SegUrl: xxx&segId=media_3824.ts
SegSize: 3256724
BufferSize: 67108864
BufferLevel: 3256724
SegType: 0

HLS segment info index: 0 Sequence: 0
StreamBandwidth: 3000
Sequence: 0
SegUrl: xxx&segId=media_3824.ts
SegStartTime: 0

Download segment info index: 1 data: 0
Sequence: 1
Status: 0
SegBitrate: 3000
DownloadDuration: 1
SegUrl: xxx&segId=media_3825.ts
SegSize: 3251836
BufferSize: 67108864
BufferLevel: 4246544
SegType: 0

Download segment info index: 2 data: 0
Sequence: 2
Status: 0
SegBitrate: 3000
DownloadDuration: 11
SegUrl: xxx&segId=media_3826.ts
SegSize: 3232284
BufferSize: 67108864
BufferLevel: 6997548
SegType: 0

Download segment info index: 3 data: 0
Sequence: 3
Status: 0
SegBitrate: 3000
DownloadDuration: 1
SegUrl: xxx&segId=media_3827.ts
SegSize: 3248640
BufferSize: 67108864
BufferLevel: 9813036
SegType: 0

Download segment info index: 4 data: 0
Sequence: 4
Status: 0
SegBitrate: 3000
DownloadDuration: 12
SegUrl: xxx&segId=media_3828.ts
SegSize: 3254468
BufferSize: 67108864
BufferLevel: 12409692
SegType: 0

Download segment info index: 5 data: 0
Sequence: 5
Status: 0
SegBitrate: 3000
DownloadDuration: 2
SegUrl: xxx&segId=media_3829.ts
SegSize: 3311244
BufferSize: 67108864
BufferLevel: 14710248
SegType: 0

HLS segment info index: 10010 Sequence: 1
StreamBandwidth: 3000
Sequence: 1
SegUrl: xxx&segId=media_3825.ts
SegStartTime: 10010

and this continues indefinitely, with the Download segment info events progressing through Sequence numbers and media_xxxx.ts segment url's.

Eventually, my last logged Download segment info event is:

Download segment info index: 13 data: 0
Sequence: 13
Status: 0
SegBitrate: 3000
DownloadDuration: 2
SegUrl: xxx&segId=media_3837.ts
SegSize: 3163100
BufferSize: 67108864
BufferLevel: 15139452
SegType: 0

and I'm currently streaming:

HLS segment info index: 90324 Sequence: 9
StreamBandwidth: 3000
Sequence: 9
SegUrl: xxx&segId=media_3833.ts
SegStartTime: 90324

This is when I hit the Instant Replay button (the rewind button has similar issues), and the "Download segment info" events stop, and never restart. I get:

Playback paused. index: 0 data: 0
Stream started. index: 98 data: 0
StreamBitrate: 0
MeasuredBitrate: 5044
Url: xxx
IsUnderrun: false

HLS segment info index: 80214 Sequence: 8
StreamBandwidth: 3000
Sequence: 8
SegUrl: xxx&segId=media_3832.ts
SegStartTime: 80214

HLS segment info index: 90324 Sequence: 9
StreamBandwidth: 3000
Sequence: 9
SegUrl: xxx&segId=media_3833.ts
SegStartTime: 90324

HLS segment info index: 100334 Sequence: 10
StreamBandwidth: 3000
Sequence: 10
SegUrl: xxx&segId=media_3834.ts
SegStartTime: 100334

HLS segment info index: 110344 Sequence: 11
StreamBandwidth: 3000
Sequence: 11
SegUrl: xxx&segId=media_3835.ts
SegStartTime: 110344

HLS segment info index: 120354 Sequence: 12
StreamBandwidth: 3000
Sequence: 12
SegUrl: xxx&segId=media_3836.ts
SegStartTime: 120354

HLS segment info index: 130364 Sequence: 13
StreamBandwidth: 3000
Sequence: 13
SegUrl: xxx&segId=media_3837.ts
SegStartTime: 130364

Stream started. index: 158 data: 0
StreamBitrate: 0
MeasuredBitrate: 5044
Url: xxx
IsUnderrun: true

Notice that the Instant Replay does back up from segment sequence number 9 to sequence 8, replays that segment, replays 9, and then continues to play the previously downloaded segment sequence numbers 10 through 13, but never continues downloading new segments.

Is my event loop supposed to be responsible for doing anything to get the stream to resume? It certainly seems that the video player component is handling everything to do with this Instant Replay (or Rewind), and there's nothing for my app to do.

Any insight or suggestions would be greatly appreciated.

Jon
0 Kudos