Skip to content
On this page

dash.js

👉 https://github.com/Dash-Industry-Forum/dash.js

▶ Run Code
js
function playMpd(video, url, art) {
    if (dashjs.supportsMediaSource()) {
        const dash = dashjs.MediaPlayer().create();
        dash.initialize(video, url, art.option.autoplay);

        // optional
        art.dash = dash; 
        art.once('url', () => dash.destroy());
        art.once('destroy', () => dash.destroy());
    } else {
        art.notice.show = 'Unsupported playback format: mpd';
    }
}

var art = new Artplayer({
    container: '.artplayer-app',
    url: 'https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd',
    type: 'mpd',
    customType: {
        mpd: playMpd
    },
});

art.on('ready', () => {
    console.info(art.dash);
});