-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.php
More file actions
100 lines (94 loc) · 3.73 KB
/
Copy pathservice.php
File metadata and controls
100 lines (94 loc) · 3.73 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
/*
Copyright 2008 - Peer Oliver Schmidt
GPLv2 Licensed
*/
/*
* This file is used to display the detail page for the supplied media file
* identified by PK_File
*/
include_once("lib.inc.php");
include_once("libVDR.php");
error_reporting(E_ALL);
connectDB();
/* $currentUser = 1;
$currentScreen = 1;
$currentRoom = 3;
$PK_File = 0;
*/ global $pk_file,$currentUser, $currentScreen, $currentRoom, $currentEntertainArea, $link, $mediaLink, $currentMediaPlayer;
if (isset($_COOKIE["currentUser"])) { $currentUser = $_COOKIE["currentUser"]; }
if (isset($_COOKIE["currentRoom"])) { $currentRoom = $_COOKIE["currentRoom"]; }
$remotetype = "";
if (isset($_POST["room"])) {
$currentRoom = $_POST["room"];
$currentRoom = intval($currentRoom);
$currentEntertainArea = getEntertainArea($link,$currentRoom);
}
if (isset($_POST["screen"])) {
$currentScreen = $_POST["screen"];
$currentScreen = intval($currentScreen);
}
if (isset($_POST["user"])) {
$currentUser = $_POST["user"];
}
if (isset($_POST["pk_file"])) {
$PK_File = $_POST["pk_file"];
}
if (isset($_POST["remotetype"])) {
$remoteType = $_POST["remotetype"];
$currentMediaPlayer = $remoteType;
}
if (isset($_POST["command"])) {
$command = $_POST["command"];
} else {
$command = 'play';
}
$file=fopen("/tmp/test.txt","w+");
fwrite($file,"command= $command");
fwrite($file,"xpkfile= $PK_File");
fwrite($file,"currentuser = $currentUser");
fwrite($file,"currentroom = $currentRoom");
foreach($_POST as $key => $value) {
fwrite($file,"$key=$value ");
}
fclose($file);
if ($command == 'play') {
if ($remoteType == 'TV') {
playRecording($currentRoom,$PK_File);
} else {
playFile($mediaLink,$PK_File);
};
} elseif ($command == 'stop') {
sendPlayerCommand($currentRoom,44); // MH_Stop_Media
} elseif ($command == 'up') {
sendPlayerCommand($currentRoom,28,array(array("50", "Up"))); // Jump Position in Play list
} elseif ($command == 'down') {
sendPlayerCommand($currentRoom,28,array(array("50", "Down"))); // Jump Position in Play list
} elseif ($command == 'left') {
sendPlayerCommand($currentRoom,28,array(array("50", "Left"))); // Jump Position in Play list
} elseif ($command == 'right') {
sendPlayerCommand($currentRoom,28,array(array("50", "Right"))); // Jump Position in Play list
} elseif ($command == 'skipfwd') {
// sendPlayerCommand($currentRoom,63); // Skip_Fwd /
sendPlayerCommand($currentRoom,65,array(array("5", "+1"))); // Jump Position in Play list
} elseif ($command == 'skipback') {
sendPlayerCommand($currentRoom,65,array(array("5", "-1"))); // Jump Position in Play list
// sendPlayerCommand($currentRoom,64); // Skip_Back
} elseif ($command == 'progfwd') {
// sendPlayerCommand($currentRoom,63); // Skip_Fwd /
sendPlayerCommand($currentRoom,65,array(array("5", "+1"))); // Jump Position in Play list
} elseif ($command == 'progback') {
sendPlayerCommand($currentRoom,65,array(array("5", "-1"))); // Jump Position in Play list
// sendPlayerCommand($currentRoom,64); // Skip_Back
} elseif ($command == 'louder') {
sendPlayerCommand($currentRoom,89); // Mute
} elseif ($command == 'quieter') {
sendPlayerCommand($currentRoom,90); // Mute
} elseif ($command == 'mute') {
sendPlayerCommand($currentRoom,97); // Mute
} elseif ($command == 'brighter') {
sendCommand(-104,223); // BrightnessUp
} elseif ($command == 'darker') {
sendCommand(-104,224); // BrightnessDown
}
?>