From 5720fbdab0eec1aec74cd6cd167cf2e0b605e49e Mon Sep 17 00:00:00 2001 From: Garrett Singer Date: Tue, 27 Jul 2021 16:04:51 -0400 Subject: [PATCH] refactor: rename master manifest to main manifest (#141) --- src/segment/segmentBase.js | 2 +- src/toM3u8.js | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/segment/segmentBase.js b/src/segment/segmentBase.js index 8e855df3..eb7397e0 100644 --- a/src/segment/segmentBase.js +++ b/src/segment/segmentBase.js @@ -70,7 +70,7 @@ export const segmentsFromBase = (attributes) => { export const addSidxSegmentsToPlaylist = (playlist, sidx, baseUrl) => { // Retain init segment information const initSegment = playlist.sidx.map ? playlist.sidx.map : null; - // Retain source duration from initial master manifest parsing + // Retain source duration from initial main manifest parsing const sourceDuration = playlist.sidx.duration; // Retain source timeline const timeline = playlist.timeline || 0; diff --git a/src/toM3u8.js b/src/toM3u8.js index 8ca5184d..e3e1e62a 100644 --- a/src/toM3u8.js +++ b/src/toM3u8.js @@ -280,7 +280,7 @@ export const toM3u8 = (dashPlaylists, locations, sidxMapping = {}) => { return {}; } - // grab all master attributes + // grab all main manifest attributes const { sourceDuration: duration, type, @@ -293,7 +293,7 @@ export const toM3u8 = (dashPlaylists, locations, sidxMapping = {}) => { const vttPlaylists = dashPlaylists.filter(vttOnly); const captions = dashPlaylists.map((playlist) => playlist.attributes.captionServices).filter(Boolean); - const master = { + const manifest = { allowCache: true, discontinuityStarts: [], segments: [], @@ -310,30 +310,31 @@ export const toM3u8 = (dashPlaylists, locations, sidxMapping = {}) => { }; if (minimumUpdatePeriod >= 0) { - master.minimumUpdatePeriod = minimumUpdatePeriod * 1000; + manifest.minimumUpdatePeriod = minimumUpdatePeriod * 1000; } if (locations) { - master.locations = locations; + manifest.locations = locations; } if (type === 'dynamic') { - master.suggestedPresentationDelay = suggestedPresentationDelay; + manifest.suggestedPresentationDelay = suggestedPresentationDelay; } - const isAudioOnly = master.playlists.length === 0; + const isAudioOnly = manifest.playlists.length === 0; if (audioPlaylists.length) { - master.mediaGroups.AUDIO.audio = organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly); + manifest.mediaGroups.AUDIO.audio = + organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly); } if (vttPlaylists.length) { - master.mediaGroups.SUBTITLES.subs = organizeVttPlaylists(vttPlaylists, sidxMapping); + manifest.mediaGroups.SUBTITLES.subs = organizeVttPlaylists(vttPlaylists, sidxMapping); } if (captions.length) { - master.mediaGroups['CLOSED-CAPTIONS'].cc = organizeCaptionServices(captions); + manifest.mediaGroups['CLOSED-CAPTIONS'].cc = organizeCaptionServices(captions); } - return master; + return manifest; };