update demo

This commit is contained in:
Harvey committed 2022-10-27 16:11:00 +08:00
1 parent 97c73c1115
commit 46de63b86e
57 files changed
+227 -177

No files matched your search

+14 -2
View File
@@ -6,15 +6,27 @@ var art = new Artplayer({
artplayerPluginHlsQuality({
// Show quality in control
control: true,
// Show quality in setting
setting: true,
// Name of setting panel
name: 'Hls Quality',
// I18n
title: 'Quality',
auto: 'Auto',
}),
],
customType: {
m3u8: function (video, url) {
if (Hls.isSupported()) {
// Destroy the last decoder instance before switching url
if (art.hls) art.hls.destroy();
// When the player is destroyed, the decoder instance must also be destroyed
art.on('destroy', () => {
if (art.hls) art.hls.destroy();
});
// Attach the Hls instance to the Artplayer instance
art.hls = new Hls();
art.hls.loadSource(url);
art.hls.attachMedia(video);