Skip to content

Commit

Permalink
update var name and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Sep 22, 2020
1 parent f48f657 commit c953221
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ export const setupMediaPlaylists = (master, useNameForId) => {

while (i--) {
const playlist = master.playlists[i];
const createId = createPlaylistID(i, playlist.uri);
let id = createId;
const createdId = createPlaylistID(i, playlist.uri);
let id = createdId;

// DASH Representations can change order across refreshes which can make referring to them by index not work
// Instead, use the provided id, available via the NAME attribute.
// If useNameForId is set, use the NAME attribute for the ID.
// Generally, this will be used for DASH because
// DASH Representations can change order across refreshes which can make referring to them by index not work.
if (useNameForId) {
id = playlist.attributes && playlist.attributes.NAME || id;
}
Expand All @@ -122,8 +123,8 @@ export const setupMediaPlaylists = (master, useNameForId) => {
id
});
playlist.resolvedUri = resolveUrl(master.uri, playlist.uri);
// make sure that if a DASH is used, the old "createId" id is also available
master.playlists[createId] = playlist;
// make sure that if a useNameForId is true, the old "createdId" id is also available
master.playlists[createdId] = playlist;
master.playlists[playlist.id] = playlist;
// URI reference added for backwards compatibility
master.playlists[playlist.uri] = playlist;
Expand Down

0 comments on commit c953221

Please sign in to comment.