From 090a1b6f7d48d68c59413892c13c1f6b3b10aded Mon Sep 17 00:00:00 2001 From: Harvey Date: Mon, 6 Dec 2021 10:23:12 +0800 Subject: [PATCH] add some polyfill to demo --- docs/assets/js/common.js | 8 ++++---- docs/index.html | 7 ++++++- packages/artplayer/src/subtitle.js | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/assets/js/common.js b/docs/assets/js/common.js index a655139b1..26aac5ac4 100644 --- a/docs/assets/js/common.js +++ b/docs/assets/js/common.js @@ -108,7 +108,7 @@ } function runExample(name) { - fetch(`./assets/example/${name}.js`) + fetch('./assets/example/' + name + '.js') .then(function (response) { return response.text(); }) @@ -150,9 +150,9 @@ var code = mirror.getValue(); eval(code); initArt(Artplayer.instances[0]); - console.debug(`Artplayer@${Artplayer.version}`); - console.debug(`Env@${Artplayer.env}`); - console.debug(`Build@${formatDate(Artplayer.build)}`); + console.debug('Artplayer@' + Artplayer.version); + console.debug('Env@' + Artplayer.env); + console.debug('Build@' + formatDate(Artplayer.build)); } function initApp() { diff --git a/docs/index.html b/docs/index.html index 064275cea..d5489d89a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -67,13 +67,17 @@
+ + + + - + \ No newline at end of file diff --git a/packages/artplayer/src/subtitle.js b/packages/artplayer/src/subtitle.js index 360daf61f..47d8d93f0 100644 --- a/packages/artplayer/src/subtitle.js +++ b/packages/artplayer/src/subtitle.js @@ -109,6 +109,7 @@ export default class Subtitle extends Component { proxy(this.textTrack, 'cuechange', this.update.bind(this)); } + errorHandle(window.fetch, 'fetch not support'); return fetch(url) .then((response) => response.arrayBuffer()) .then((buffer) => {