mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 02:21:20 -08:00
add artplayer-plugin-dash-quality
This commit is contained in:
1 parent
3f399e4b41
commit
f472410a3b
171 files changed
+3241
-2025
No files matched your search
@@ -0,0 +1,34 @@
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: 'https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd',
|
||||
setting: true,
|
||||
plugins: [
|
||||
artplayerPluginDashQuality({
|
||||
// Show quality in control
|
||||
control: true,
|
||||
|
||||
// Show quality in setting
|
||||
setting: true,
|
||||
|
||||
// Get the resolution text from level
|
||||
getResolution: (level) => level.height + 'P',
|
||||
|
||||
// I18n
|
||||
title: 'Quality',
|
||||
auto: 'Auto',
|
||||
}),
|
||||
],
|
||||
customType: {
|
||||
mpd: function playMpd(video, url, art) {
|
||||
if (dashjs.supportsMediaSource()) {
|
||||
const dash = dashjs.MediaPlayer().create();
|
||||
dash.initialize(video, url, art.option.autoplay);
|
||||
art.dash = dash;
|
||||
art.once('url', () => dash.destroy());
|
||||
art.once('destroy', () => dash.destroy());
|
||||
} else {
|
||||
art.notice.show = 'Unsupported playback format: mpd';
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user