Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature use max segment duration #3292

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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