This commit is contained in:
amehime
2020-10-04 23:26:20 +08:00
parent 1fdeb290f5
commit a296c2f795
2 changed files with 17 additions and 8 deletions

View File

@@ -85,6 +85,7 @@ Hexo5可以在根目录新建一个yml文件命名为`_config.shoka.yml`。
💡 增加语言包:`繁体中文``日语`
💡 quiz功能优化根据语言显示题型标签
🔧 修复评论功能中反复初始化leancloud-storage
🔧 修复`audio: false`时不能隐藏播放按钮、停止播放
## 0.2 👉 0.2.1
⚠️ 配置文件添加 `loader` 参数,[配置戳此](config/#加载动画)

View File

@@ -252,19 +252,21 @@ const mediaPlayer = function(config) {
var that = this;
callback = callback || function() {}
if(!this.loaded) {
utils.fetch(this.options.rawList).then(function(list) {
that.playlist = list;
create.list();
that.setMode(t.media.options.mode);
that.loaded = true;
callback();
});
if(this.options.rawList)
utils.fetch(this.options.rawList).then(function(list) {
that.playlist = list;
create.list();
that.setMode(t.media.options.mode);
that.loaded = true;
callback();
});
} else {
callback()
}
},
load: function(newList) {
if(newList) {
var d = "block"
if(newList && newList.length > 0) {
if(this.options.rawList !== newList) {
this.options.rawList = newList;
if(this.loaded) {
@@ -272,6 +274,12 @@ const mediaPlayer = function(config) {
this.fetch();
}
}
} else {
d = "none"
this.pause()
}
for(var el in this.buttons) {
this.buttons[el].display(d)
}
},
// 根据模式切换当前曲目pointer