mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-13 07:46:17 -08:00
Update artplayer plugin versions
This commit is contained in:
1 parent
b235f9bbac
commit
d8720d3bcf
14 files changed
+366
-257
No files matched your search
@@ -0,0 +1,31 @@
|
||||
function playFlv(video, url, art) {
|
||||
if (mpegts.isSupported()) {
|
||||
if (art.flv) art.flv.destroy();
|
||||
|
||||
const flv = mpegts.createPlayer({
|
||||
type: 'flv',
|
||||
url: url
|
||||
});
|
||||
flv.attachMediaElement(video);
|
||||
flv.load();
|
||||
flv.play();
|
||||
|
||||
art.flv = flv;
|
||||
art.on('destroy', () => flv.destroy());
|
||||
} else {
|
||||
art.notice.show = 'Unsupported playback format: flv';
|
||||
}
|
||||
}
|
||||
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.flv',
|
||||
type: 'flv',
|
||||
customType: {
|
||||
flv: playFlv,
|
||||
},
|
||||
});
|
||||
|
||||
art.on('ready', () => {
|
||||
console.info(art.flv);
|
||||
});
|
||||
Reference in new issue
Block a user