-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmedia.php
70 lines (67 loc) · 2.72 KB
/
media.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
<?php
//
// NanoServ: Home Server
// | Module -> Media
//
require("include/functions.php");
$headaddons = '<link rel="stylesheet" href="modules/media/media.css" type="text/css" media="screen" />'.
'<link rel="stylesheet" href="modules/media/php_file_tree/filetree.css" type="text/css" media="screen" />';
require('include/header.php');
$opt["width"] = $_GET["width"];
$opt["height"] = $_GET["height"];
function optional($alt,$default) {
if(!empty($alt)) return $alt; else return $default;
}
?>
<script src="include/jquery.js" type="text/javascript"></script>
<script src="modules/media/swfobject.js" type="text/javascript"></script>
<script src="modules/media/php_file_tree/php_file_tree_jquery.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
function switch_media(newitem) {
if(newitem != "modules/media/backend.php") {$.post("modules/media/backend.php", {file: newitem});}
$("#newplaylist").load('modules/media/backend.php'); $("#playlist").html($("#newplaylist").html());
document.getElementById('theswf').sendEvent('LOAD', newitem);
}
function syncPlaylist() {
if($("#synctoserver").attr("checked") == true) {
$("#newplaylist").load('modules/media/backend.php');
newplaylist = $("#newplaylist").html();
playlist = $("#playlist").html();
if(newplaylist != playlist) {
$("#playlist").html(newplaylist);
switch_media("modules/media/backend.php");
}
timeout = setTimeout("syncPlaylist()", 2000);
}
}
function jumpMenu() {
var newIndex = document.sizejumpform.sizejump.selectedIndex;
cururl = document.sizejumpform.sizejump.options[ newIndex ].value;
window.location.assign( cururl );
}
$(function() {
$("#synctoserver").click(function() {
syncPlaylist();
});
});
-->
</script>
<div id="box" style="width:<?php echo optional($opt["width"],$cfg["media-player"]["default-width"])+300;?>px;height:480px;">
<?php include('modules/media/player.php');?>
<?php include('modules/media/browser.php');?>
<div id="mediasettings">
<label for="synctoserver"><input id="synctoserver" name="synctoserver" type="checkbox" value="1" /> Sync to Server</label>
<form name="sizejumpform" action="media.php">
<select name="sizejump" onchange="jumpMenu()">
<option value="media.php?width=720&height=480" <?php if($opt["width"]==720) echo "selected"?>>720x480</option>
<option value="media.php?width=640&height=480" <?php if($opt["width"]==640) echo "selected"?>>640x480</option>
<option value="media.php?width=320&height=240" <?php if($opt["width"]==320) echo "selected"?>>320x240</option>
</select>
<input type="button" name="Button1" value="Go" onclick="jumpMenu()" />
</form>
</div>
</div>
<div id="playlist"></div>
<div id="newplaylist"></div>
<?php include('include/footer.php'); ?>