-
Notifications
You must be signed in to change notification settings - Fork 793
Processing segment reachable even after playlist update removes it #939
Processing segment reachable even after playlist update removes it #939
Conversation
When a playlist is refreshed, the segments in the new playlist are copies of the old segments. That means that if playlist is refreshed between segment request and xhr completing, we will annotate the old segment object at: |
Good call @imbcmdth . Here are a couple approaches (I think (1) is better, but there are definitely alternatives from these as well):
|
mediaSource.sourceBuffers[0].trigger('updateend'); | ||
|
||
assert.equal(loader.state, 'WAITING', 'in waiting state'); | ||
assert.equal(loader.pendingSegment_.uri, '1.ts', 'second segment pending'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to also check loader.pendingSegment_.segment.uri
is what you expect whenver checking loader.pendingSegment_.uri
to to make sure the new segment object we are attaching to segmentInfo
is the correct reference
@@ -279,6 +279,13 @@ export default class SegmentLoader extends videojs.EventTarget { | |||
|
|||
if (segmentInfo && !segmentInfo.isSyncRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we only do these adjustments for non-sync requests. It probably doesn't matter if we don't save the info on an outdated segment object when its a sync-request because we don't append it and if we do need to append it in the future, we are going to have to re-request/probe/sync it anyway. However, I think it probably doesn't hurt to make sure the timing info we get from the probe of the sync request to be put onto the segment object. It might help make other calculations that fallback to target duration when start and end times are unavailable be more accurate
279f6e4
to
c4a3f26
Compare
LFGTM |
Description
In live scenarios, a refresh may render a processing segment unreachable. This attaches the segment to the segmentInfo object so the segment will always be around.
Requirements Checklist