Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Commit 88e880a

Browse files
authored
Merge pull request #191 from Orange-OpenSource/start-over
Start-over
2 parents a9b4ffd + 90c987b commit 88e880a

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

app/js/mss/MssFragmentController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Mss.dependencies.MssFragmentController = function() {
8888

8989
// Update segment timeline according to DVR window
9090
if (manifest.timeShiftBufferDepth && manifest.timeShiftBufferDepth > 0) {
91-
if (segmentsUpdated) {
91+
if (segmentsUpdated && manifest.startOver !== true) {
9292
// Get timestamp of the last segment
9393
segment = segments[segments.length - 1];
9494
t = segment.t;

app/js/mss/MssParser.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,15 @@ Mss.dependencies.MssParser = function() {
505505
mpd.type = (isLive !== null && isLive.toLowerCase() === 'true') ? 'dynamic' : 'static';
506506
mpd.timeShiftBufferDepth = parseFloat(this.domParser.getAttributeValue(smoothNode, 'DVRWindowLength')) / TIME_SCALE_100_NANOSECOND_UNIT;
507507
var duration = parseFloat(this.domParser.getAttributeValue(smoothNode, 'Duration'));
508+
509+
// If live manifest with Duration and no DVRWindowLength, we consider it as a start-over manifest
510+
if (mpd.type === "dynamic" && duration > 0) {
511+
mpd.timeShiftBufferDepth = duration / TIME_SCALE_100_NANOSECOND_UNIT;
512+
duration = 0;
513+
mpd.startOver = true;
514+
}
515+
516+
// Complete manifest/mpd initialization
508517
mpd.mediaPresentationDuration = (duration === 0) ? Infinity : (duration / TIME_SCALE_100_NANOSECOND_UNIT);
509518
mpd.BaseURL = baseURL;
510519
mpd.minBufferTime = MediaPlayer.dependencies.BufferExtensions.DEFAULT_MIN_BUFFER_TIME;

app/js/streaming/MediaPlayer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ MediaPlayer = function () {
844844
{
845845
url : "[manifest url]",
846846
startTime : [start time in seconds (optional, only for static streams)],
847+
startOver : [true if start-over DVR stream (optional)],
847848
protocol : "[protocol type]", // 'HLS' to activate native support on Safari/OSx
848849
protData : {
849850
// one entry for each key system ('com.microsoft.playready' or 'com.widevine.alpha')

app/js/streaming/StreamController.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ MediaPlayer.dependencies.StreamController = function() {
269269
return false;
270270
}
271271

272+
// Specific use case of "start-over" or "session DVR" live streams
273+
// We set this information in the manifest, to be used by MssFragmentController for DVR window updating
274+
if (source.startOver) {
275+
manifest.startOver = true;
276+
}
277+
272278
this.debug.info("[StreamController] composeStreams");
273279

274280
if (this.capabilities.supportsEncryptedMedia()) {

0 commit comments

Comments
 (0)