浏览代码

fix if videoEl.dataset[c] is undefined , JSON.parse will crash

pu 5 年前
父节点
当前提交
3c53598460
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/video/video.js

+ 1
- 1
src/video/video.js 查看文件

@@ -44,7 +44,7 @@ export default (
44 44
                 PROPERTIES.reduce((p, c) => {
45 45
                     p[c] = this.videoEl && this.videoEl[c];
46 46
                     if (c == 'playbackrates' && this.videoEl) {
47
-                        if (this.videoEl.dataset) {
47
+                        if (this.videoEl.dataset && this.videoEl.dataset[c]) {
48 48
                             p[c] = JSON.parse(this.videoEl.dataset[c]);
49 49
                         } else {
50 50
                             p[c] = JSON.parse(this.videoEl.getAttribute("data-" + c));