mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
完成gif插件
This commit is contained in:
1 parent
d535423dd8
commit
c9dfc883ab
11 files changed
+352
-54
No files matched your search
+5
-11
@@ -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);
|
||||
});
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user