blob: ffcc9e622a5cd00771b95204d03dfd2184ae4ebc (
plain)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
<?php
function getGlobals()
{
global $vdrstreamdev, $vdrrecpath, $mediasource;
$ret = array();
$ret['streamdev_server'] = $vdrstreamdev;
$ret['rec_path'] = $vdrrecpath;
$ret['video_path'] = "/mnt/media/Video/";
$ret['audio_path'] = "/mnt/media/Music/";
return json_encode($ret);
}
function getTvCat()
{
$ret = array();
$ret['categories'] = vdrgetcategories();
return json_encode($ret);
}
function getFullChanList()
{
$catlist = array();
// Get all categories
$categories = vdrgetcategories();
// For all categories
$count = count($categories);
for ($i = 0; $i < $count; $i++)
{
$tmpcat = array();
$tmpcat['name'] = $categories[$i]['name'];
$tmpcat['channel'] = vdrgetchannels($tmpcat['name'], 0);
$catlist[] = $tmpcat;
}
$ret = array();
$ret['category'] = $catlist;
return json_encode($ret);
}
function getTvChan($cat)
{
$ret = array();
$ret['channel'] = vdrgetchannels($cat, 1);
return json_encode($ret);
}
function getChanInfo($channum)
{
$ret = array();
$info = array();
$ret['program'] = vdrgetchaninfo($channum);
return json_encode($ret);
}
function startBroadcast($type, $url, $mode)
{
$ret = array();
$ret['session'] = substr(sessioncreate($type, $url, $mode), strlen("session"));
return json_encode($ret);
}
function stopBroadcast($session)
{
$ret = array();
$ret = sessiondelete("session" .$session);
return json_encode($ret);
}
function getStreamInfo($session)
{
$ret = array();
$info = sessiongetinfo("session" .$session);
$info['session'] = substr($info['session'], strlen("session"));
$ret['stream'] = $info;
return json_encode($ret);
}
function getStreamStatus($session)
{
$ret = sessiongetstatus("session" .$session);
return json_encode($ret);
}
function getRunningSessions()
{
$ret = array();
$ret['broadcast'] = sessiongetlist();
return json_encode($ret);
}
?>
|