Upload base files from development machine
This commit is contained in:
34
player-init-plugin-v2.js
Normal file
34
player-init-plugin-v2.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* This script is an init script designed for hooverhigh
|
||||
* HooverHighVideoPlayer 1 <https://hooverhigh.ml/>
|
||||
* Copyright oxmc. <https://oxmc.xyz/>
|
||||
*/
|
||||
|
||||
window.addEventListener('HVJS-Load', async (event) => {
|
||||
console.log('HVJS-Load event recived, Adding player script');
|
||||
console.log("Player-init.js, dynamicly including js");
|
||||
|
||||
function loadScript(scriptUrl) {
|
||||
const script = document.createElement('script');
|
||||
script.src = scriptUrl;
|
||||
document.body.appendChild(script);
|
||||
|
||||
return new Promise((res, rej) => {
|
||||
script.onload = function() {
|
||||
res();
|
||||
}
|
||||
script.onerror = function() {
|
||||
rej();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Run player.js:
|
||||
await loadScript('https://hooverhigh.ml/videojs-plugins/player.js').then(() => {
|
||||
console.log('Script loaded!');
|
||||
}).catch(() => {
|
||||
console.error('Player-init-plugin Script loading failed!');
|
||||
});
|
||||
|
||||
console.log("End Player-init-plugin.js");
|
||||
});
|
Reference in New Issue
Block a user