diff options
author | TheTroll <trolldev@gmail.com> | 2010-03-17 13:20:30 +0100 |
---|---|---|
committer | TheTroll <trolldev@gmail.com> | 2010-03-17 13:20:30 +0100 |
commit | d890fd4beb74429626b3d49b008b645889f8bbe0 (patch) | |
tree | eddc7877f449636d923f1ffdecaf460dc5d75017 /bin/jsonapi.php | |
parent | 2699eecff7856183c6f0ef45a5e1eab2cf92d6e0 (diff) | |
download | istreamdev-d890fd4beb74429626b3d49b008b645889f8bbe0.tar.gz istreamdev-d890fd4beb74429626b3d49b008b645889f8bbe0.tar.bz2 |
Implemented startBroacast
PHP files cleanup
Diffstat (limited to 'bin/jsonapi.php')
-rwxr-xr-x | bin/jsonapi.php | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/bin/jsonapi.php b/bin/jsonapi.php new file mode 100755 index 0000000..35ec623 --- /dev/null +++ b/bin/jsonapi.php @@ -0,0 +1,77 @@ +<?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'] = sessioncreate($type, $url, $mode); + + return json_encode($ret); +} + + +?> |