From a4ce9136e6ed527c65f8ef8bd723f8ad6de8e56d Mon Sep 17 00:00:00 2001 From: thlo Date: Sat, 29 Dec 2012 14:16:45 +0100 Subject: Increase JavaScript robustness. --- smarttv-client/Javascript/Config.js | 7 +++++++ smarttv-client/Javascript/Main.js | 2 +- smarttv-client/Javascript/Player.js | 11 ++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'smarttv-client') diff --git a/smarttv-client/Javascript/Config.js b/smarttv-client/Javascript/Config.js index 518c6e6..c260be1 100755 --- a/smarttv-client/Javascript/Config.js +++ b/smarttv-client/Javascript/Config.js @@ -42,6 +42,13 @@ Config.init = function () { if (this.deviceType == 0) { // This is a Samsung Smart TV + if (this.serverUrl != "") { + // Hardcoded server URL. Done with config + Main.log ("Hardcoded server URL. Done with config"); + Config.fetchConfig(); + return; + } + try { this.cfgFileName = curWidget.id + "/config.dta"; } diff --git a/smarttv-client/Javascript/Main.js b/smarttv-client/Javascript/Main.js index ca82fe4..7103068 100755 --- a/smarttv-client/Javascript/Main.js +++ b/smarttv-client/Javascript/Main.js @@ -474,7 +474,7 @@ Main.getKeyCode = function(code) { if (Config.deviceType != 0) { // Not a Samsung - res = "Unknown Key (" + code + ")"; + res = "Unknown Key (KeyCode= " + code + ")"; return res; } switch(code) { diff --git a/smarttv-client/Javascript/Player.js b/smarttv-client/Javascript/Player.js index 404cfda..77f124c 100755 --- a/smarttv-client/Javascript/Player.js +++ b/smarttv-client/Javascript/Player.js @@ -37,7 +37,16 @@ Player.init = function() { this.state = this.STOPPED; this.plugin = document.getElementById("pluginPlayer"); - + +/* var pl_version = ""; + try { + pl_version = this.plugin.GetPlayerVersion(); + } + catch (e) { + Main.logToServer("Error while getting player version: " +e); + } + Main.logToServer("PlayerVersion= " + pl_version); +*/ if (!this.plugin) { Main.log("success vale this.plugin : " + success); -- cgit v1.2.3