mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 20:26:16 -08:00
弹幕暴露isHide属性
This commit is contained in:
1 parent
18e8629641
commit
e96c57c4c1
3 files changed
+27
-3
No files matched your search
@@ -19,7 +19,7 @@ var art = new Artplayer({
|
||||
subtitle: {
|
||||
url: url + '/subtitle/one-more-time-one-more-chance.srt',
|
||||
style: {
|
||||
color: '#03A9F4',
|
||||
color: '#fff',
|
||||
fontSize: '14px',
|
||||
},
|
||||
},
|
||||
@@ -41,6 +41,26 @@ var art = new Artplayer({
|
||||
loading: '<img src="./assets/img/ploading.gif">',
|
||||
state: '<img src="./assets/img/state.png">',
|
||||
},
|
||||
plugins: [
|
||||
artplayerPluginDanmuku({
|
||||
danmuku: url + '/danmuku/one-more-time-one-more-chance.xml',
|
||||
speed: 5,
|
||||
maxlength: 100,
|
||||
margin: [10, 50],
|
||||
opacity: 1,
|
||||
fontSize: 14,
|
||||
synchronousPlayback: false,
|
||||
}),
|
||||
],
|
||||
controls: [
|
||||
{
|
||||
position: 'right',
|
||||
html: '弹幕',
|
||||
click: function () {
|
||||
art.plugins.artplayerPluginDanmuku.hide();
|
||||
},
|
||||
},
|
||||
],
|
||||
whitelist: ['*'],
|
||||
});
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
</div>
|
||||
<script src="https://cdn.bootcss.com/vConsole/3.2.0/vconsole.min.js"></script>
|
||||
<script src="./uncompiled/artplayer.js"></script>
|
||||
<script src="./uncompiled/artplayer-plugin-danmuku.js"></script>
|
||||
<script src="./assets/js/mobile.js"></script>
|
||||
<script>
|
||||
var isLocalhost = Boolean(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Danmuku from './danmuku';
|
||||
|
||||
export default function artplayerPluginDanmuku(option) {
|
||||
return art => {
|
||||
return (art) => {
|
||||
const danmuku = new Danmuku(art, option);
|
||||
return {
|
||||
name: 'artplayerPluginDanmuku',
|
||||
@@ -9,6 +9,9 @@ export default function artplayerPluginDanmuku(option) {
|
||||
config: danmuku.config.bind(danmuku),
|
||||
hide: danmuku.hide.bind(danmuku),
|
||||
show: danmuku.show.bind(danmuku),
|
||||
get isHide() {
|
||||
return danmuku.isHide;
|
||||
},
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user