diff --git a/get-info.js b/get-info.js index 159298c8..9afb5b74 100644 --- a/get-info.js +++ b/get-info.js @@ -30,7 +30,12 @@ function getJSON(options, callback) { catch(e) { Logger.errlog.log("JSON fail: " + options.path); var m = buffer.match(/([^<]+)<\/internalReason>/); - callback(m[1] || true, res.statusCode, null); + if(m) { + callback(m[1], res.statusCode, null); + } + else { + callback(true, res.statusCode, null); + } return; } callback(false, res.statusCode, data); @@ -55,7 +60,12 @@ function getJSONHTTPS(options, callback) { catch(e) { Logger.errlog.log("JSON fail: " + options.path); var m = buffer.match(/([^<]+)<\/internalReason>/); - callback(m[1] || true, res.statusCode, null); + if(m) { + callback(m[1], res.statusCode, null); + } + else { + callback(true, res.statusCode, null); + } return; } callback(false, res.statusCode, data); diff --git a/www/acp.html b/www/acp.html index 7236fe0f..119db195 100644 --- a/www/acp.html +++ b/www/acp.html @@ -77,6 +77,7 @@ +

             
diff --git a/www/assets/js/acp.js b/www/assets/js/acp.js
index 759d6821..1062f900 100644
--- a/www/assets/js/acp.js
+++ b/www/assets/js/acp.js
@@ -123,6 +123,12 @@ $("#actionlog_time").click(function() {
     tableResort($("#actionlog table"), "time");
 });
 
+function reverseLog() {
+    $("#log").text($("#log").text().split("\n").reverse().join("\n"));
+}
+
+$("#log_reverse").click(reverseLog);
+
 function getSyslog() {
     $.ajax(WEB_URL+"/api/plain/readlog?type=sys&"+AUTH).done(function(data) {
         $("#log").text(data);
diff --git a/www/assets/js/player.js b/www/assets/js/player.js
index fc456788..4ac399d3 100644
--- a/www/assets/js/player.js
+++ b/www/assets/js/player.js
@@ -58,6 +58,7 @@ var Player = function(data) {
             this.nullPlayer();
             break;
     }
+    this.load(data);
 }
 
 Player.prototype.nullPlayer = function() {
@@ -114,19 +115,23 @@ Player.prototype.initYouTube = function() {
     }
 
     this.pause = function() {
-        this.player.pauseVideo();
+        if(this.player.pauseVideo)
+            this.player.pauseVideo();
     }
 
     this.play = function() {
-        this.player.playVideo();
+        if(this.player.playVideo)
+            this.player.playVideo();
     }
 
     this.getTime = function(callback) {
-        callback(this.player.getCurrentTime());
+        if(this.player.getCurrentTime)
+            callback(this.player.getCurrentTime());
     }
 
     this.seek = function(time) {
-        this.player.seekTo(time, true);
+        if(this.player.seekTo)
+            this.player.seekTo(time, true);
     }
 }
 
diff --git a/www/assets/js/ui.js b/www/assets/js/ui.js
index 76934c7b..5e9e5e6e 100644
--- a/www/assets/js/ui.js
+++ b/www/assets/js/ui.js
@@ -190,6 +190,8 @@ $("#userpl_save").click(function() {
             var caret = btn.find(".caret").detach();
             btn.text($(select).text());
             caret.appendTo(btn);
+            if(PLAYER.type == "yt" && PLAYER.player.setPlaybackQuality)
+                PLAYER.player.setPlaybackQuality(VIDEOQUALITY);
         });
     }
     qualHandler("#quality_240p", "small");
@@ -199,6 +201,12 @@ $("#userpl_save").click(function() {
     qualHandler("#quality_1080p", "hd1080");
 })();
 
+$("#mediarefresh").click(function() {
+    PLAYER.type = "";
+    PLAYER.id = "";
+    socket.emit("playerReady");
+});
+
 /* playlist controls */
 
 $("#queue").sortable({
diff --git a/www/channel.html b/www/channel.html
index 0850022e..dc69c0f2 100644
--- a/www/channel.html
+++ b/www/channel.html
@@ -156,6 +156,7 @@
                         
  • 1080p
  • +