How to use the mpd-parser.parse function in mpd-parser

To help you get started, we’ve selected a few mpd-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github videojs / http-streaming / src / dash-playlist-loader.js View on Github external
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;
    }
github videojs / http-streaming / src / dash-playlist-loader.js View on Github external
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)
      );
    }

mpd-parser

mpd parser

Apache-2.0
Latest version published 1 month ago

Package Health Score

89 / 100
Full package analysis

Popular mpd-parser functions