Update: plugin source code files

This commit is contained in:
2026-01-06 19:25:41 +09:00
parent 786e2b5026
commit 1ad3d0767a
12 changed files with 1497 additions and 692 deletions

View File

@@ -64,6 +64,52 @@
return;
}
post_ajax('/download', get_formdata('#download'));
post_ajax('/basic/download', getFormdata('#download'));
});
// Artplayer 미리보기 로직
let art = null;
let last_preview_url = '';
const init_artplayer = (video_url) => {
const wrapper = document.getElementById('player-wrapper');
wrapper.style.display = 'block';
if (art) {
art.switchUrl(video_url);
return;
}
art = new Artplayer({
container: '#player-wrapper',
url: video_url,
autoplay: false,
pip: true,
setting: true,
flip: true,
playbackRate: true,
aspectRatio: true,
fullscreen: true,
fullscreenWeb: true,
miniProgressBar: true,
mutex: true,
backdrop: true,
playsInline: true,
autoPlayback: false,
airplay: true,
theme: '#23ade5',
});
};
url.addEventListener('change', () => {
const target_url = url.value.trim();
if (target_url && target_url.startsWith('http') && target_url !== last_preview_url) {
last_preview_url = target_url;
post_ajax('/basic/preview', { url: target_url }).then((ret) => {
if (ret.ret === 'success' && ret.data) {
init_artplayer(ret.data);
}
});
}
});
})();