完成gif插件

This commit is contained in:
Harvey Zack committed 2018-12-06 15:39:47 +08:00
1 parent d535423dd8
commit c9dfc883ab
11 files changed
+352 -54

No files matched your search

+5 -11
View File
@@ -17,24 +17,18 @@
var art = new Artplayer({
container: '.artplayer',
url: 'https://blog.zhw-island.com/assets-cdn/video/one-more-time-one-more-chance-480p.mp4',
title: '【新海诚动画】『秒速5センチメートル』',
autoSize: true,
controls: [
{
name: 'preview',
position: 'right',
html: '打开'
html: '打开',
mounted: $preview => {
art.plugins.localPreview.attach($preview);
},
},
],
plugins: [artplayerPluginGif]
});
art.on('firstCanplay', () => {
var preview = document.querySelector('.art-control-preview');
art.plugins.localPreview.attach(preview);
art.plugins.artplayerPluginGif.create({}, image => {
var animatedImage = document.createElement('img');
animatedImage.src = image;
document.querySelector('.preview').appendChild(animatedImage);
});
});
})();