Skip to content

Commit 135bb9a

Browse files
committed
fix: support timeshift dash manifests without startNumber attribute
1 parent 01ca182 commit 135bb9a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/dash-playlist-loader.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ import logger from './util/logger';
2424
const { EventTarget, mergeOptions } = videojs;
2525

2626
const dashPlaylistUnchanged = function(a, b) {
27+
// derive media sequence for timeshift manifests without startNumber attribute
28+
if (
29+
b.mediaSequence === 1 &&
30+
a.segments &&
31+
b.segments &&
32+
a.segments.length &&
33+
b.segments.length
34+
) {
35+
const seqDelta = a.segments.findIndex((s) => s.uri === b.segments[0].uri);
36+
37+
b.mediaSequence =
38+
a.mediaSequence + (seqDelta === -1 ? a.segments.length : seqDelta);
39+
}
40+
2741
if (!isPlaylistUnchanged(a, b)) {
2842
return false;
2943
}

0 commit comments

Comments
 (0)