-
Notifications
You must be signed in to change notification settings - Fork 8
/
en-player.php
87 lines (83 loc) · 2.37 KB
/
en-player.php
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
include("./includes/common.php");
$hash = isset($_GET['hash'])?trim($_GET['hash']):exit();
$row = $DB->getRow("SELECT * FROM pre_file WHERE hash=:hash", [':hash'=>$hash]);
if(!$row)exit('404 Not Found');
if($row['block']!=0)exit('File is blocked!');
$name = $row['name'];
$type = $row['type'];
$viewurl = $siteurl.'view.php/'.$row['hash'].'.'.$type;
$type_audio = explode('|',$conf['type_audio']);
$type_video = explode('|',$conf['type_video']);
if(in_array($type, $type_audio)){
$title = 'Music player - '.$conf['title'];
$filetype = 2;
}elseif(in_array($type, $type_video)){
$title = 'Video player - '.$conf['title'];
$filetype = 3;
}else{
exit('NO player');
}
@header('Content-Type: text/html; charset=UTF-8');
?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8"/>
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title><?php echo $title ?></title>
<link rel="stylesheet" href="//cdn.staticfile.org/aplayer/1.10.1/APlayer.min.css">
<script src="//cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
<style type="text/css">
body {
margin:0px 0px 0px 0px;
}
</style>
</head>
<body>
<div id="preview" align="center">
<?php
if($filetype==2){
echo '<div id="aplayer"></div>';
}elseif($filetype==3){
echo '<div class="videosamplex"><video id="videoplayer"></video></div>';
}else{
exit;
}
?>
</div>
<?php if($filetype==2){?>
<script type="text/javascript" src="//cdn.staticfile.org/aplayer/1.10.1/APlayer.min.js"></script>
<script type="text/javascript">
var ap1 = new APlayer({
element: document.getElementById('aplayer'),
narrow: false,
autoplay: false,
showlrc: false,
mutex: true,
theme: '#b2dae6',
music: {
title: '<?php echo $name?>',
author: '',
url: '<?php echo $viewurl?>',
}
});
</script>
<?php }elseif($filetype==3){?>
<script type="text/javascript" src="./assets/js/ckplayer.min.js"></script>
<script type="text/javascript">
var videoObject = {
container: '.videosamplex',
variable: 'player',
mobileCkControls:true,
mobileAutoFull:false,
h5container:'#videoplayer',
flashplayer:false,
video:'<?php echo $viewurl?>'
};
var player=new ckplayer(videoObject);
</script>
<?php }?>
</body>
</html>