Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parseMasterXml() {
const master = parseMpd(this.masterXml_, {
manifestUri: this.srcUrl,
clientOffset: this.clientOffset_,
sidxMapping: this.sidxMapping_
});
master.uri = this.srcUrl;
// Set up phony URIs for the playlists since we won't have external URIs for DASH
// but reference playlists by their URI throughout the project
// TODO: Should we create the dummy uris in mpd-parser as well (leaning towards yes).
for (let i = 0; i < master.playlists.length; i++) {
const phonyUri = `placeholder-uri-${i}`;
master.playlists[i].uri = phonyUri;
}
export const filterChangedSidxMappings = (masterXml, srcUrl, clientOffset, oldSidxMapping) => {
// Don't pass current sidx mapping
const master = parseMpd(masterXml, {
manifestUri: srcUrl,
clientOffset
});
const videoSidx = compareSidxEntry(master.playlists, oldSidxMapping);
let mediaGroupSidx = videoSidx;
forEachMediaGroup(master, (properties, mediaType, groupKey, labelKey) => {
if (properties.playlists && properties.playlists.length) {
const playlists = properties.playlists;
mediaGroupSidx = mergeOptions(
mediaGroupSidx,
compareSidxEntry(playlists, oldSidxMapping)
);
}