Skip to content

MPD manifest load from string XML. Method aditional to load from URL

Vinay Rosenberg requested to merge github/fork/mittaus/development into development

Created by: mittaus

Load MPD manifest from string variable XML

Example:

const source = '<?xml version="1.0" ?> <MPD mediaPresentationDuration="PT46.797S" minBufferTime="PT15.35S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011"> <Period> <!-- Video --> <AdaptationSet maxHeight="720" maxWidth="1280" mimeType="video/mp4" minHeight="720" minWidth="1280" segmentAlignment="true" startWithSAP="1"> <Representation bandwidth="878193" codecs="avc1.4D401F" frameRate="143017/5965" height="720" id="video-avc1" scanType="progressive" width="1280"> <BaseURL>/video/media-video-avc1.mp4</BaseURL> <SegmentBase indexRange="721-800"> <Initialization range="0-720"/> </SegmentBase> </Representation> </AdaptationSet> <!-- Audio --> <AdaptationSet mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1"> <Representation audioSamplingRate="44100" bandwidth="95025" codecs="mp4a.40.2" id="audio-und-mp4a"> <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"/> <BaseURL>/video/media-audio-und-mp4a.mp4</BaseURL> <SegmentBase indexRange="620-699"> <Initialization range="0-619"/> </SegmentBase> </Representation> </AdaptationSet> </Period> </MPD>'

const dash = dashjs.MediaPlayer().create() const video: HTMLVideoElement = document.querySelector('video[name="media"]') dash.getDebug().setLogToBrowserConsole(true) dash.initialize(video, source, true)

Merge request reports