# Module: DashAdapter

The DashAdapter module can be accessed using the MediaPlayer API getDashAdapter()

Source:
  - dash/DashAdapter.js, line 43

### Methods

#### applyPatchToManifest(manifest, patch)

  Takes a given patch and applies it to the provided manifest, assumes patch is valid for manifest

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `manifest` | object |
  `patch` | object |

  Source:
    - dash/DashAdapter.js, line 896

#### areMediaInfosEqual(mInfoOne, mInfoTwo)

  Compares two mediaInfo objects

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `mInfoOne` | MediaInfo |
  `mInfoTwo` | MediaInfo |

  Source:
    - dash/DashAdapter.js, line 197

  ##### Returns:

  Type
    boolean

#### getAdaptationForType(periodIndex, type, streamInfo)

  Returns the AdaptationSet for a given period index and a given mediaType.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `periodIndex` | number |
  `type` | MediaType |
  `streamInfo` | object |

  Source:
    - dash/DashAdapter.js, line 163

  ##### Returns:

  adaptation

  Type
    null | object

#### getAllMediaInfoForType(streamInfo, type, externalManifest)

  Returns all the mediaInfos for a given mediaType and the corresponding streamInfo.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `streamInfo` | object |
  `type` | MediaType |
  `externalManifest` | object | Set to null or undefined if no external manifest is to be used

  Source:
    - dash/DashAdapter.js, line 293

  ##### Returns:

  mediaArr

  Type
    Array

#### getAvailabilityStartTime(externalManifest)

  Returns the availabilityStartTime as specified in the manifest

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `externalManifest` | object | Omit this value if no external manifest should be used

  Source:
    - dash/DashAdapter.js, line 601

  ##### Returns:

  availabilityStartTime

  Type
    number

#### getBandwidthForRepresentation(representationId, periodIdx)

  Returns the bandwidth for a given representation id and the corresponding period index

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `representationId` | number |
  `periodIdx` | number |

  Source:
    - dash/DashAdapter.js, line 788

  ##### Returns:

  bandwidth

  Type
    number

#### getCodec(adaptation, representationId, addResolutionInfo)

  Returns the codec for a given adaptation set and a given representation id.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `adaptation` | object |
  `representationId` | number |
  `addResolutionInfo` | boolean | Defines whether to include resolution information in the output

  Source:
    - dash/DashAdapter.js, line 776

  ##### Returns:

  codec

  Type
    String

#### getContentSteering(manifest)

  Returns the ContentSteering element of the MPD

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `manifest` | object |

  Source:
    - dash/DashAdapter.js, line 661

  ##### Returns:

  contentSteering

  Type
    object

#### getDuration(externalManifest)

  Returns the duration of the MPD

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `externalManifest` | object | Omit this value if no external manifest should be used

  Source:
    - dash/DashAdapter.js, line 625

  ##### Returns:

  duration

  Type
    number

#### getIndexForRepresentation(representationId, periodIdx)

  Returns the index for a given representation id

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `representationId` | string |
  `periodIdx` | number |

  Source:
    - dash/DashAdapter.js, line 805

  ##### Returns:

  index

  Type
    number

#### getIsDynamic(externalManifest)

  Returns a boolean indicating if the manifest is dynamic or not

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `externalManifest` | object | Omit this value if no external manifest should be used

  Source:
    - dash/DashAdapter.js, line 613

  ##### Returns:

  Type
    boolean

#### getIsMain(adaptation)

  Checks if the role of the specified AdaptationSet is set to main

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `adaptation` | object |

  Source:
    - dash/DashAdapter.js, line 148

  ##### Returns:

  Type
    boolean

#### getIsPatch(manifest)

  Checks if the manifest is actually just a patch manifest

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `manifest` | object |

  Source:
    - dash/DashAdapter.js, line 740

  ##### Returns:

  Type
    boolean

#### getIsTypeOf(adaptation, type)

  Checks if the given AdaptationSet is from the given media type

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `adaptation` | object |
  `type` | string |

  Source:
    - dash/DashAdapter.js, line 855

  ##### Returns:

  Type
    boolean

#### getLocation(manifest)

  Returns the location element of the MPD

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `manifest` | object |

  Source:
    - dash/DashAdapter.js, line 672

  ##### Returns:

  location

  Type
    String

#### getManifestUpdatePeriod(manifest, latencyOfLastUpdate)

  Returns the manifest update period used for dynamic manifests

  ##### Parameters:

  Name | Type | Default | Description
  --- | --- | --- | ---
  `manifest` | object |  |
  `latencyOfLastUpdate` | number | 0 |

  Source:
    - dash/DashAdapter.js, line 684

  ##### Returns:

  manifestUpdatePeriod

  Type
    NaN | number

#### getMaxIndexForBufferType(bufferType, periodIdx)

  This method returns the current max index based on what is defined in the MPD.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `bufferType` | string | String 'audio' or 'video',
  `periodIdx` | number | Make sure this is the period index not id

  Source:
    - dash/DashAdapter.js, line 819

  ##### Returns:

  Type
    number

#### getMediaInfoForType(streamInfo, type)

  Returns a MediaInfo object for a given media type and the corresponding streamInfo.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `streamInfo` | object |
  `type` | MediaType |

  Source:
    - dash/DashAdapter.js, line 124

  ##### Returns:

  mediaInfo

  Type
    null | MediaInfo

#### getMpd(externalManifest)

  Returns an MPD object

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `externalManifest` | object | Omit this value if no external manifest should be used

  Source:
    - dash/DashAdapter.js, line 649

  ##### Returns:

  MPD

  Type
    object

#### getPatchLocation(manifest)

  Returns the patch locations of the MPD if existing and if they are still valid

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `manifest` | object |

  Source:
    - dash/DashAdapter.js, line 706

  ##### Returns:

  patch location

  Type
    Array.<PatchLocation>

#### getPeriodById(id)

  Returns the voPeriod object for a given id

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `id` | String |

  Source:
    - dash/DashAdapter.js, line 832

  ##### Returns:

  Type
    object | null

#### getProducerReferenceTimes(streamInfo, mediaInfo)

  Returns the ProducerReferenceTimes as saved in the DashManifestModel if present

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `streamInfo` | object |
  `mediaInfo` | object |

  Source:
    - dash/DashAdapter.js, line 402

  ##### Returns:

  producerReferenceTimes

  Type
    object

#### getPublishTime(manifest)

  Returns the publish time from the manifest

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `manifest` | object |

  Source:
    - dash/DashAdapter.js, line 695

  ##### Returns:

  publishTime

  Type
    Date | null

#### getRealAdaptation(streamInfo, mediaInfo)

  Returns the AdaptationSet as saved in the DashManifestModel

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `streamInfo` | object |
  `mediaInfo` | object |

  Source:
    - dash/DashAdapter.js, line 379

  ##### Returns:

  realAdaptation

  Type
    object

#### getRealPeriodByIndex(index)

  Returns the period as defined in the DashManifestModel for a given index

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `index` | number |

  Source:
    - dash/DashAdapter.js, line 436

  ##### Returns:

  Type
    object

#### getRegularPeriods(externalManifest)

  Returns all periods of the MPD

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `externalManifest` | object | Omit this value if no external manifest should be used

  Source:
    - dash/DashAdapter.js, line 637

  ##### Returns:

  periods

  Type
    Array

#### getSuggestedPresentationDelay()

  Returns the suggestedPresentationDelay as specified in the manifest

  Source:
    - dash/DashAdapter.js, line 589

  ##### Returns:

  suggestedPresentationDelay

  Type
    String

#### getUTCTimingSources()

  Returns the UTC Timing Sources specified in the manifest

  Source:
    - dash/DashAdapter.js, line 578

  ##### Returns:

  utcTimingSources

  Type
    Array

#### getVoRepresentations(mediaInfo)

  Returns all voRepresentations for a given mediaInfo

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `mediaInfo` | object |

  Source:
    - dash/DashAdapter.js, line 447

  ##### Returns:

  voReps

  Type
    Array

#### isPatchValid(manifest, patch)

  Checks if the supplied manifest is compatible for application of the supplied patch

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `manifest` | object |
  `patch` | object |

  Source:
    - dash/DashAdapter.js, line 872

  ##### Returns:

  Type
    boolean

#### Search results