summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/backend.php2
-rw-r--r--js/istreamdev.js18
2 files changed, 17 insertions, 3 deletions
diff --git a/bin/backend.php b/bin/backend.php
index 1c99f7e..3eaa127 100755
--- a/bin/backend.php
+++ b/bin/backend.php
@@ -1,6 +1,6 @@
<?php
-header('Content-type: text/html');
+header('Content-Type: application/json; charset: UTF-8');
if (file_exists('../config.php'))
include ('../config.php');
diff --git a/js/istreamdev.js b/js/istreamdev.js
index 0f0fd2b..9bc4a8a 100644
--- a/js/istreamdev.js
+++ b/js/istreamdev.js
@@ -1,4 +1,4 @@
-//INIT
+//INIT
jQT = new $.jQTouch({
icon: 'img/istreamdev.png',
addGlossToIcon: true,
@@ -137,11 +137,24 @@ $('#audio_but').tap(function(event) {
$('#runningsessions li a').tap(function(event) {
event.preventDefault();
- var session = $(this).attr('rel');
json_start(this);
+ var session = $(this).attr('rel');
+ if (session=="killsessions") {
+ var dataString = 'action=stopBroadcast&session=all';
+ $.getJSON("bin/backend.php",
+ dataString,
+ function(data) {
+ var status = data.status;
+ var message = data.message;
+ hide_loader();
+ getRunningSessions();
+ });
+ } else {
gen_streaming(session);
+ }
return false;
});
+
// show active sessions
$(document).ready(function(e){
getRunningSessions();
@@ -174,6 +187,7 @@ var dataString = "action=getRunningSessions";
else if (type == 'vid') { var pic='video.png'; }
$('#home #runningsessions').append('<li class="arrow"><a rel="' + session + '" href="#"><img class="menuicon" src="img/' + pic + '" /><span class="menuname">*Live: ' + name + '</span></a></li>');
});
+ $('#home #runningsessions').append('<li><a rel="killsessions" href="#"><span class="menuname">Stop all sessions</span></a></li>');
}
else {
$('#home #runningsessions').append('<li><span class="menuname">No running session</span></li>');