Browse Source

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

pu 5 years ago
parent
commit
3c53598460
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/video/video.js

+ 1
- 1
src/video/video.js View File

@@ -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));