-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshowmovie.html
More file actions
72 lines (65 loc) · 1.43 KB
/
Copy pathshowmovie.html
File metadata and controls
72 lines (65 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Movie</title>
<script src="/e/artplayer.js"></script>
<script src="/e/jquery-3.5.1.min.js"></script>
<style>
.artplayer-app {
width: 640px;
height: 480px;
}
</style>
</head>
<body>
<input onclick="selmovie()" type="button" value="Play"><select id="selectlist"></select>
<div class="artplayer-app" id="divplayer"></div>
<script>
var art;
let liststr="";
$.ajax({
type: "GET",
url: "/list",
async:false
}).done(function(msg) {
var fis=msg.toString().split(",");
for(i=0;i<fis.length;i++){
if(fis[i]!=""){
var showtmp=fis[i];
var li=showtmp.lastIndexOf("/");
if(li>0){
showtmp=showtmp.substring(li+1);
}
document.getElementById("selectlist").options.add(new Option(showtmp,fis[i]));
}
}
});
function selmovie(){
var m=document.getElementById("selectlist").value;
if(typeof(art)!='undefined'){
art.destroy();
}
art = new Artplayer({
container: '.artplayer-app',
url: m,
volume: 0.5,
muted: false,
autoplay: false,
pip: true,
autoSize: true,
screenshot: true,
setting: true,
loop: false,
playbackRate: true,
aspectRatio: true,
fullscreen: true,
fullscreenWeb: true,
mutex: true,
theme: '#ffad00',
lang: 'zh-cn'
});
}
</script>
</body>
</html>