Package com.castlabs.android.player

# Class MPDParser

java.lang.Object
org.xml.sax.helpers.DefaultHandler
com.google.android.exoplayer2.source.dash.manifest.DashManifestParser
com.castlabs.android.player.MPDParser

All Implemented Interfaces:
  `com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<com.google.android.exoplayer2.source.dash.manifest.DashManifest>`, `ContentHandler`, `DTDHandler`, `EntityResolver`, `ErrorHandler`

public class MPDParser extends com.google.android.exoplayer2.source.dash.manifest.DashManifestParser
Extends the default ExoPlayer DASH Manifest parsers. The extension correctly parses the channel count for dolby tracks The mspr:pro content protection entries are parsed and scheme data are initialized for it. The extension merges video adaptation sets when requested. We avoid an `IllegalStateException` to be raised when representations contain inconsistent ContentProtection entries. This happens with eDash packager when using different keys for HD and SD. We work around the issue by falling back to the first ContentProtection that we found for a given schemeId.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.google.android.exoplayer2.source.dash.manifest.DashManifestParser

  `com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.PeriodUrlInfo`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `SCHEME_ID_URL_SET_SWITCHING`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MPDParser(boolean prescan, boolean mergeVideoAdaptationSets)`
  `MPDParser(boolean prescan, boolean mergeVideoAdaptationSets, long minManifestUpdatePeriodMs, long availabilityStartTimeOffsetOverwriteMs)`
  `MPDParser(boolean prescan, boolean mergeVideoAdaptationSets, long minManifestUpdatePeriodMs, long availabilityStartTimeOffsetOverwriteMs, long subtitleSubSampleOffsetUs)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `com.google.android.exoplayer2.source.dash.manifest.DashManifest`
  `parse(Uri uri, InputStream inputStream)`

  ### Methods inherited from class com.google.android.exoplayer2.source.dash.manifest.DashManifestParser

  `maybeSkipTag`

  ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

  `characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### SCHEME_ID_URL_SET_SWITCHING

    public static final String SCHEME_ID_URL_SET_SWITCHING
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### MPDParser

    public MPDParser(boolean prescan, boolean mergeVideoAdaptationSets)

  - ### MPDParser

    public MPDParser(boolean prescan, boolean mergeVideoAdaptationSets, long minManifestUpdatePeriodMs, long availabilityStartTimeOffsetOverwriteMs)

  - ### MPDParser

    public MPDParser(boolean prescan, boolean mergeVideoAdaptationSets, long minManifestUpdatePeriodMs, long availabilityStartTimeOffsetOverwriteMs, long subtitleSubSampleOffsetUs)

- ## Method Details

  - ### parse

    @NonNull public com.google.android.exoplayer2.source.dash.manifest.DashManifest parse(Uri uri, InputStream inputStream) throws IOException
    Specified by:
      `parse` in interface `com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<com.google.android.exoplayer2.source.dash.manifest.DashManifest>`
    Overrides:
      `parse` in class `com.google.android.exoplayer2.source.dash.manifest.DashManifestParser`
    Throws:
      `IOException`