Compare commits
3 Commits
master
...
artplayer_
Author | SHA1 | Date |
---|---|---|
qkqpttgf | fdbe65292e | |
qkqpttgf | 61df78a005 | |
qkqpttgf | 95b43461e8 |
|
@ -352,7 +352,7 @@ function main($path)
|
||||||
$files = json_decode('{"type":"folder"}', true);
|
$files = json_decode('{"type":"folder"}', true);
|
||||||
} elseif ($_SERVER['ishidden']==4) {
|
} elseif ($_SERVER['ishidden']==4) {
|
||||||
if (!getConfig('downloadencrypt', $_SERVER['disktag'])) {
|
if (!getConfig('downloadencrypt', $_SERVER['disktag'])) {
|
||||||
$files = json_decode('{"type":"folder"}', true);
|
$files = json_decode('{"type":"file"}', true);
|
||||||
} else {
|
} else {
|
||||||
$files = $drive->list_files($path1);
|
$files = $drive->list_files($path1);
|
||||||
if ($files['type']=='folder') $files = json_decode('{"type":"folder"}', true);
|
if ($files['type']=='folder') $files = json_decode('{"type":"folder"}', true);
|
||||||
|
|
|
@ -187,7 +187,10 @@
|
||||||
<img src="<!--FileEncodeUrl-->" alt="<!--FileName-->" onload="if (this.offsetWidth>document.getElementById('url').offsetWidth) this.style.width='100%';if (this.offsetHeight>document.documentElement.clientHeight) this.style.height=document.documentElement.clientHeight + 'px';" />
|
<img src="<!--FileEncodeUrl-->" alt="<!--FileName-->" onload="if (this.offsetWidth>document.getElementById('url').offsetWidth) this.style.width='100%';if (this.offsetHeight>document.documentElement.clientHeight) this.style.height=document.documentElement.clientHeight + 'px';" />
|
||||||
<!--IsimgFileEnd-->
|
<!--IsimgFileEnd-->
|
||||||
<!--IsvideoFileStart-->
|
<!--IsvideoFileStart-->
|
||||||
<div id="video-a0"></div>
|
<div id="video-a0" class="artplayerdiv"></div>
|
||||||
|
<!--<script src="https://artplayer.org/uncompiled/artplayer.js"></script>-->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/artplayer@4.1.0/dist/artplayer.min.js"></script>
|
||||||
|
<!--<script src="https://unpkg.com/artplayer@4.1.0/dist/artplayer.js"></script>-->
|
||||||
<!--IsvideoFileEnd-->
|
<!--IsvideoFileEnd-->
|
||||||
<!--IsmusicFileStart-->
|
<!--IsmusicFileStart-->
|
||||||
<audio src="<!--FileDownUrl-->" controls="controls" style="width: 100%"></audio>
|
<audio src="<!--FileDownUrl-->" controls="controls" style="width: 100%"></audio>
|
||||||
|
@ -548,70 +551,136 @@
|
||||||
}
|
}
|
||||||
<!--IstxtFileEnd-->
|
<!--IstxtFileEnd-->
|
||||||
<!--IsvideoFileStart-->
|
<!--IsvideoFileStart-->
|
||||||
function loadResources(type, src, callback) {
|
//document.getElementById('video-a0').style.height = window.innerHeight + 'px';
|
||||||
let script = document.createElement(type);
|
var fileurl = "<!--FileEncodeUrl-->";
|
||||||
let loaded = false;
|
var filename1 = fileurl.substr(0, fileurl.lastIndexOf('.'));
|
||||||
if (typeof callback === 'function') {
|
var art = new Artplayer({
|
||||||
script.onload = script.onreadystatechange = () => {
|
//container: '#video-a0',
|
||||||
if (!loaded && (!script.readyState || /loaded|complete/.test(script.readyState))) {
|
container: '.artplayerdiv',
|
||||||
script.onload = script.onreadystatechange = null;
|
url: fileurl,
|
||||||
loaded = true;
|
title: fileurl,
|
||||||
callback();
|
autoHeight: true,
|
||||||
}
|
//autoplay: true,
|
||||||
}
|
pip: true,
|
||||||
}
|
autoSize: true,
|
||||||
if (type === 'link') {
|
autoMini: true,
|
||||||
script.href = src;
|
//loop: true,
|
||||||
script.rel = 'stylesheet';
|
fullscreen: true,
|
||||||
} else {
|
fullscreenWeb: true,
|
||||||
script.src = src;
|
subtitleOffset: true,
|
||||||
}
|
miniProgressBar: true,
|
||||||
document.getElementsByTagName('head')[0].appendChild(script);
|
//localVideo: true,
|
||||||
}
|
//localSubtitle: true,
|
||||||
function addVideos(videos) {
|
mutex: true,
|
||||||
let host = 'https://s0.pstatp.com/cdn/expire-1-M';
|
//backdrop: true,
|
||||||
let unloadedResourceCount = 4;
|
theme: '#23ade5',
|
||||||
let callback = (() => {
|
lang: navigator.language.toLowerCase(),
|
||||||
return () => {
|
/*moreVideoAttr: {
|
||||||
if (!--unloadedResourceCount) {
|
crossOrigin: 'anonymous',
|
||||||
createDplayers(videos);
|
},
|
||||||
}
|
settings: [
|
||||||
};
|
{
|
||||||
})(unloadedResourceCount, videos);
|
index: 1,
|
||||||
loadResources(
|
html: 'Custom setting',
|
||||||
'link',
|
click: function (setting) {
|
||||||
host + '/dplayer/1.25.0/DPlayer.min.css',
|
console.info('You clicked on the custom setting');
|
||||||
callback
|
setting.show = false;
|
||||||
);
|
},
|
||||||
loadResources(
|
},
|
||||||
'script',
|
],
|
||||||
host + '/dplayer/1.25.0/DPlayer.min.js',
|
contextmenu: [
|
||||||
callback
|
{
|
||||||
);
|
html: 'Custom menu',
|
||||||
loadResources(
|
click: function (contextmenu) {
|
||||||
'script',
|
console.info('You clicked on the custom menu');
|
||||||
host + '/hls.js/0.12.4/hls.light.min.js',
|
contextmenu.show = false;
|
||||||
callback
|
},
|
||||||
);
|
},
|
||||||
loadResources(
|
],
|
||||||
'script',
|
layers: [
|
||||||
host + '/flv.js/1.5.0/flv.min.js',
|
{
|
||||||
callback
|
html: '<img style="width: 100px" src="/assets/sample/layer.png">',
|
||||||
);
|
click: function () {
|
||||||
}
|
console.info('You clicked on the custom layer');
|
||||||
function createDplayers(videos) {
|
},
|
||||||
for (i = 0; i < videos.length; i++) {
|
style: {
|
||||||
console.log(videos[i]);
|
position: 'absolute',
|
||||||
new DPlayer({
|
top: '20px',
|
||||||
container: document.getElementById('video-a' + i),
|
right: '20px',
|
||||||
screenshot: true,
|
opacity: '.9',
|
||||||
video: {
|
},
|
||||||
url: videos[i]
|
},
|
||||||
}
|
],
|
||||||
|
quality: [
|
||||||
|
{
|
||||||
|
default: true,
|
||||||
|
html: 'SD 480P',
|
||||||
|
url: '/assets/sample/video.mp4',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
html: 'HD 720P',
|
||||||
|
url: '/assets/sample/video.mp4',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
thumbnails: {
|
||||||
|
url: '/assets/sample/thumbnails.png',
|
||||||
|
number: 100,
|
||||||
|
width: 160,
|
||||||
|
height: 90,
|
||||||
|
column: 10,
|
||||||
|
},*/
|
||||||
|
subtitle: {
|
||||||
|
url: filename1+'.srt',
|
||||||
|
type: 'srt',
|
||||||
|
style: {
|
||||||
|
color: '#03A9F4',
|
||||||
|
},
|
||||||
|
encoding: 'utf-8',
|
||||||
|
bilingual: true,
|
||||||
|
},/*
|
||||||
|
highlight: [
|
||||||
|
{
|
||||||
|
time: 60,
|
||||||
|
text: 'One more chance',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
time: 120,
|
||||||
|
text: '谁でもいいはずなのに',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
time: 180,
|
||||||
|
text: '夏の想い出がまわる',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
time: 240,
|
||||||
|
text: 'こんなとこにあるはずもないのに',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
time: 300,
|
||||||
|
text: '终わり',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
controls: [
|
||||||
|
{
|
||||||
|
position: 'right',
|
||||||
|
html: 'localsubtitle',
|
||||||
|
mounted: ($preview) => {
|
||||||
|
art.plugins.localSubtitle.attach($preview);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
icons: {
|
||||||
|
indicator: '<img width="16" heigth="16" src="/assets/img/indicator.svg">',
|
||||||
|
loading: '<img src="/assets/img/ploading.gif">',
|
||||||
|
state: '<img width="150" heigth="150" src="/assets/img/state.svg">',
|
||||||
|
},*/
|
||||||
});
|
});
|
||||||
}
|
art.on('ready', (...agrs) => {
|
||||||
}
|
console.log(document.getElementById('video-a0').style.height);
|
||||||
addVideos(["<!--FileEncodeUrl-->"]);
|
//if (document.getElementById('video-a0').style.height == window.innerHeight+'px') document.getElementById('video-a0').style.height = (art.rect.height+3) + 'px';
|
||||||
|
//console.log(document.getElementById('video-a0').style.height);
|
||||||
|
//art.play();
|
||||||
|
})
|
||||||
<!--IsvideoFileEnd-->
|
<!--IsvideoFileEnd-->
|
||||||
<!--IspdfFileStart-->
|
<!--IspdfFileStart-->
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
|
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
|
||||||
|
|
Loading…
Reference in New Issue