mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 19:42:20 -08:00
update docs
This commit is contained in:
1 parent
b97e49bead
commit
e96778746a
3 files changed
+31
-34
No files matched your search
+12
-13
@@ -17,29 +17,26 @@ function initApp(app) {
|
||||
});
|
||||
}
|
||||
|
||||
function timeTaken(callback) {
|
||||
console.time('timeTaken');
|
||||
const r = callback();
|
||||
console.timeEnd('timeTaken');
|
||||
return r;
|
||||
}
|
||||
|
||||
var $error = document.querySelector('.error-tip');
|
||||
document.querySelector('.run').addEventListener('click', function (e) {
|
||||
function runApp() {
|
||||
try {
|
||||
Artplayer.instances.forEach(ins => {
|
||||
ins.destroy(true)
|
||||
});;
|
||||
timeTaken(function () {
|
||||
eval(mirror.getValue());
|
||||
});
|
||||
eval(mirror.getValue());
|
||||
initApp(Artplayer.instances[0]);
|
||||
$error.style.display = 'none';
|
||||
$error.innerHTML = '';
|
||||
} catch (error) {
|
||||
var msg = error.message.trim();
|
||||
$error.style.display = 'block';
|
||||
$error.innerHTML = '请打开控制台:' + msg;
|
||||
console.error(msg);
|
||||
}
|
||||
}
|
||||
|
||||
var $error = document.querySelector('.error-tip');
|
||||
document.querySelector('.run').addEventListener('click', function (e) {
|
||||
runApp();
|
||||
});
|
||||
|
||||
creatCodeMirror(`
|
||||
@@ -47,4 +44,6 @@ new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: 'https://blog.zhw-island.com/assets-cdn/video/one-more-time-one-more-chance-480p.mp4'
|
||||
});
|
||||
`);
|
||||
`);
|
||||
|
||||
runApp();
|
||||
Reference in new issue
Block a user