add some polyfill to demo

This commit is contained in:
Harvey committed 2021-12-06 10:23:12 +08:00
1 parent d536452067
commit 090a1b6f7d
3 files changed
+11 -5

No files matched your search

+4 -4
View File
@@ -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() {
+6 -1
View File
@@ -67,13 +67,17 @@
<div class="popups">
<div class="popinner"></div>
</div>
<script src="./assets/js/vconsole.min.js"></script>
<script src="./assets/js/core.js"></script>
<script src="./assets/js/fetch.polyfill.js"></script>
<script src="./assets/js/encoding-indexes.js"></script>
<script src="./assets/js/encoding.js"></script>
<script src="./assets/js/codemirror.js"></script>
<script src="./assets/js/javascript.js"></script>
<script src="./assets/js/console.js"></script>
<script src="./uncompiled/artplayer.js"></script>
<script src="./assets/js/common.js"></script>
<script>
// var vConsole = new VConsole();
var isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
window.location.hostname === '[::1]' ||
@@ -91,6 +95,7 @@
}
})();
</script>
<script src="./assets/js/common.js"></script>
</body>
</html>
+1
View File
@@ -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) => {