Skip to content

Commit

Permalink
Feature use max segment duration (#3292)
Browse files Browse the repository at this point in the history
* Use @maxSegmentDuration for live delay calculation if present

* Use @maxSegmentDuration for live delay calculation if present
  • Loading branch information
dsilhavy committed Jun 15, 2020
1 parent a208746 commit da9d60c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/streaming/controllers/StreamController.js
Expand Up @@ -693,13 +693,13 @@ function StreamController() {
try {
let fragmentDuration = NaN;

// For multiperiod manifests we use the maxFragmentDuration attribute as we do not know the correct starting period
if (streamInfos && streamInfos.length > 1) {
fragmentDuration = manifestInfo && !isNaN(manifestInfo.maxFragmentDuration) ? manifestInfo.maxFragmentDuration : NaN;
// We use the maxFragmentDuration attribute if present
if (manifestInfo && !isNaN(manifestInfo.maxFragmentDuration) && isFinite(manifestInfo.maxFragmentDuration)) {
return manifestInfo.maxFragmentDuration;
}

// For single period manifests we iterate over all AS and use the maximum segment length
else if (streamInfos && streamInfos.length === 1) {
// For single period manifests we can iterate over all AS and use the maximum segment length
if (streamInfos && streamInfos.length === 1) {
const streamInfo = streamInfos[0];
const mediaTypes = [Constants.VIDEO, Constants.AUDIO, Constants.FRAGMENTED_TEXT];

Expand Down

0 comments on commit da9d60c

Please sign in to comment.