From 6875170a503df081979d3b786b2b186334b31aab Mon Sep 17 00:00:00 2001 From: thlo Date: Tue, 1 Jan 2013 22:07:29 +0100 Subject: Native Volume OSD also visible on 2011 Models. Seeking duration (Jump Forward and Backward) now adjustable during playback. Minor Bug Fixes. --- smarttv-client/CSS/Main.css | 12 ++++---- smarttv-client/Javascript/Config.js | 1 + smarttv-client/Javascript/Display.js | 53 ++++++++++++++---------------------- smarttv-client/Javascript/Main.js | 22 +++++++++++++-- smarttv-client/Javascript/Options.js | 23 +++++++++++++--- smarttv-client/Javascript/Player.js | 49 ++++++++++++++++++++++++++++----- smarttv-client/config.xml | 2 +- smarttv-client/index.html | 2 ++ 8 files changed, 109 insertions(+), 55 deletions(-) diff --git a/smarttv-client/CSS/Main.css b/smarttv-client/CSS/Main.css index ae43a9e..e3ebaca 100755 --- a/smarttv-client/CSS/Main.css +++ b/smarttv-client/CSS/Main.css @@ -56,12 +56,12 @@ body { padding-top:20px; padding-left:20px; padding-right:20px; - background: url("../Images/selectView-bg.png"); - background-size: 100%; + background: rgba(6,109,171,1) 100%; background: -webkit-linear-gradient(-45deg, #1e5799 0%,#2989d8 41%,#7db9e8 100%); -webkit-box-shadow:3px 3px 7px 4px rgba(0,0,0, 0.5); } - +/* background-size: 100%; +*/ #optionsScreen { position: absolute; left: 0px; top: 0px; @@ -82,8 +82,7 @@ body { padding-top:20px; padding-left:20px; padding-right:20px; - background: url("../Images/selectView-bg.png"); - background-size: 100%; + background: rgba(6,109,171,1) 100%; background: -webkit-linear-gradient(-45deg, #1e5799 0%,#2989d8 41%,#7db9e8 100%); -webkit-box-shadow:3px 3px 7px 4px rgba(0,0,0, 0.5); } @@ -157,7 +156,6 @@ body { border-width:1px; background: url("../Images/rightHalf-bg.png"); - background-size: 100%; background: -webkit-linear-gradient(-45deg, #1e5799 0%,#2989d8 41%,#7db9e8 100%); } @@ -189,6 +187,7 @@ body { text-overflow : ellipsis; -webkit-box-shadow:3px 3px 7px 4px rgba(0,0,0, 0.5); + background: url("../Images/description-bg.png"); background-size: 100%; background: -webkit-linear-gradient(-45deg, #1e5799 0%,#2989d8 41%,#7db9e8 100%); @@ -200,7 +199,6 @@ body { left: 10px; top:40px; width:50%; height:90%; background: url("../Images/leftHalf-bg.png"); - background-size: 100%; background: -webkit-linear-gradient(-45deg, #1e5799 0%,#2989d8 41%,#7db9e8 100%); border-style:solid; border-width:1px; diff --git a/smarttv-client/Javascript/Config.js b/smarttv-client/Javascript/Config.js index c260be1..8718fb5 100755 --- a/smarttv-client/Javascript/Config.js +++ b/smarttv-client/Javascript/Config.js @@ -243,6 +243,7 @@ Config.processConfig = function () { res = Config.getXmlValue("liveChannels"); if (res != 0) noLiveChannels = res; + Player.skipDuration = Config.skipDuration; Main.log("**** Config ****"); Main.log("serverUrl= " + Config.serverUrl); Main.log("format= " + Config.format); diff --git a/smarttv-client/Javascript/Display.js b/smarttv-client/Javascript/Display.js index 5c68b53..71b4c71 100755 --- a/smarttv-client/Javascript/Display.js +++ b/smarttv-client/Javascript/Display.js @@ -142,6 +142,12 @@ Display.setOlTitle = function (title) { Display.putInnerHTML(elm, Display.olTitle); }; +Display.resetStartStop = function () { + Display.olStartStop = ""; + var elm = document.getElementById("olStartStop"); + Display.putInnerHTML(elm, Display.olStartStop); + +}; Display.setStartStop = function(start, stop) { this.olStartStop = ""; @@ -163,41 +169,14 @@ Display.setStartStop = function(start, stop) { Display.putInnerHTML(elm, Display.olStartStop); }; -/* -Display.getHumanTimeRepresentation = function(time) { - var totalTimeHour = 0; - var totalTimeMinute = 0; - var totalTimeSecond = 0; - - totalTimeHour = Math.floor(time/3600000); - totalTimeMinute = Math.floor((time%3600000)/60000); - totalTimeSecond = Math.floor((time%60000)/1000); - - var totalTimeStr = totalTimeHour + ":"; +Display.setSkipDuration = function(duration) { + this.olStartStop = ""; - if(totalTimeMinute == 0) - totalTimeStr += "00:"; - else if(totalTimeMinute <10) - totalTimeStr += "0" + totalTimeMinute + ":"; - else - totalTimeStr += totalTimeMinute + ":"; - - if(totalTimeSecond == 0) - totalTimeStr += "00"; - else if(totalTimeSecond <10) - totalTimeStr += "0" + totalTimeSecond; - else - totalTimeStr += totalTimeSecond; + this.olStartStop = duration; - return totalTimeStr; -}; -*/ -/* -// called by Player.OnStreamInfoReady -Display.updateTotalTime = function(time) { - Player.totalTimeStr = Display.getHumanTimeRepresentation(time); + var elm = document.getElementById("olStartStop"); + Display.putInnerHTML(elm, "Next Skip: " + Display.olStartStop+"sec"); }; -*/ // Player.OnCurrentPlayTime Display.updatePlayTime = function() { @@ -411,6 +390,7 @@ Display.setVideoList = function(selected, first) { Display.selectItem = function (item) { item.style.color = "black"; + item.style.background = "white"; item.style.background = "-webkit-linear-gradient(top, rgba(246,248,249,1) 0%,rgba(229,235,238,1) 50%,rgba(215,222,227,1) 51%,rgba(245,247,249,1) 100%)"; item.style.borderRadius= "3px"; item.style["-webkit-box-shadow"] = "2px 2px 1px 2px rgba(0,0,0, 0.5)"; @@ -589,7 +569,14 @@ Display.handlerHidePopup = function() { Display.putInnerHTML(document.getElementById("popup"), ""); }; -//--------------------------------------------------------- +/* --------------------------------------------------------- + * Progress Bar Handlers + * --------------------------------------------------------- + */ + +Display.isProgressOlShown = function () { + return this.progOlHandler.active; +}; Display.showProgress = function() { this.progOlHandler.show(); diff --git a/smarttv-client/Javascript/Main.js b/smarttv-client/Javascript/Main.js index 7d71e4d..da302d8 100755 --- a/smarttv-client/Javascript/Main.js +++ b/smarttv-client/Javascript/Main.js @@ -66,7 +66,12 @@ var Main = { }; Main.onLoad = function() { - window.onShow = showHandler; + if (typeof(window.onShow) == "function" ) { + window.onShow = showHandler; + } + if (typeof(window.onshow) == "function" ) { + window.onshow = showHandler; + } Network.init(); try { @@ -376,7 +381,7 @@ Main.playItem = function (url) { document.getElementById("olRecProgressBar").display="none"; } Display.setOlTitle(Data.getCurrentItem().childs[Main.selectedVideo].title); - Display.olStartStop = ""; + Display.resetStartStop(); break; }; @@ -889,6 +894,10 @@ cPlayStateKeyHndl.prototype.handleKeyDown = function () { Player.resumeVideo(); } Player.ResetTrickPlay(); + if (Display.isProgressOlShown()) { + Player.adjustSkipDuration(0); // reset skip duration to default + Display.resetStartStop(); + } Display.showProgress(); break; case tvKey.KEY_RETURN: @@ -904,7 +913,14 @@ cPlayStateKeyHndl.prototype.handleKeyDown = function () { Main.log("PAUSE"); Player.pauseVideo(); break; - + case tvKey.KEY_UP: + Player.adjustSkipDuration(1); + Display.showProgress(); + break; + case tvKey.KEY_DOWN: + Player.adjustSkipDuration(2); + Display.showProgress(); + break; /* case tvKey.KEY_UP: case tvKey.KEY_PANEL_VOL_UP: case tvKey.KEY_VOL_UP: diff --git a/smarttv-client/Javascript/Options.js b/smarttv-client/Javascript/Options.js index 31e9d50..d066c00 100755 --- a/smarttv-client/Javascript/Options.js +++ b/smarttv-client/Javascript/Options.js @@ -18,6 +18,7 @@ Options.onEnter = function () { Config.updateContext(document.getElementById("widgetServerAddr").value); + document.getElementById('widgetServerAddr').blur(); document.getElementById("optionsScreen").style.display="none"; @@ -27,7 +28,11 @@ Options.onEnter = function () { Main.changeState(0); Config.fetchConfig(); -// Main.enableKeys(); + if(_g_ime.pluginMouse_use_YN){ + this.imeBox._blur(); + }; + + // Main.enableKeys(); }; Options.onBlue = function () { @@ -40,6 +45,11 @@ Options.onImeCreated = function(obj) { // obj.setKeySetFunc('12key'); Main.logToServer ("Options.onImeCreated()"); + Main.logToServer ("[IME] ============================================ imeobj.IsSupportXT9:"+obj.IsSupportXT9); + var strKeySet = obj.getKeySet(); + Main.logToServer ("[IME] ============================================ strKeySet:"+strKeySet); + + obj.setKeyFunc(tvKey.KEY_RETURN, function(keyCode) { widgetAPI.sendReturnEvent(); return false; } ); obj.setKeyFunc(tvKey.KEY_EXIT, function(keyCode) { widgetAPI.sendExitEvent(); return false; } ); @@ -56,13 +66,18 @@ Options.onImeCreated = function(obj) { Options.imeBox.setOnCompleteFunc(Options.onComplete); + if(_g_ime.pluginMouse_use_YN){ + obj._focus(); + }; + document.getElementById('widgetServerAddr').focus(); + Main.logToServer ("Options.onReady()"); + Main.logToServer ("KeySet= " + Options.imeBox.getKeySet()); + Options.onReady (); }; Options.onReady = function () { - document.getElementById('widgetServerAddr').focus(); - Main.logToServer ("Options.onReady()"); - Main.log ("KeySet= " + this.imeBox.getKeySet()); + }; diff --git a/smarttv-client/Javascript/Player.js b/smarttv-client/Javascript/Player.js index ffdbf03..d54a761 100755 --- a/smarttv-client/Javascript/Player.js +++ b/smarttv-client/Javascript/Player.js @@ -16,6 +16,8 @@ var Player = curPlayTime : 0, // millis totalTime : -1, // millis + skipDuration : 30, + curPlayTimeStr : "00:00:00", // millis totalTimeStr : "", stopCallback : null, /* Callback function to be set by client */ @@ -55,7 +57,8 @@ Player.init = function() { Main.log("success vale this.plugin : " + success); success = false; } - + this.skipDuration = Config.skipDuration; // Use Config default also here + // var vermsg = this.plugin.GetPlayerVersion(); // Main.log ("player plugin version: " +vermsg); @@ -161,7 +164,8 @@ Player.playVideo = function() { Player.setBuffer(15000000.0); Player.ResetTrickPlay(); - + Player.skipDuration = Config.skipDuration; // reset + Main.log ("StartPlayback for " + this.url); if (this.plugin.StartPlayback() == false) Display.showPopup("StartPlayback returns false"); @@ -236,17 +240,48 @@ Player.jumpToVideo = function(percent) { }; Player.skipForwardVideo = function() { - var res = this.plugin.JumpForward(Config.skipDuration); - if (res == false) - Display.showPopup("Jump Forward ret= " + ((res == true) ? "True" : "False")); + var res = this.plugin.JumpForward(Player.skipDuration); + if (res == false) { + Display.showPopup("Jump Forward ret= " + ((res == true) ? "True" : "False")); + } + }; Player.skipBackwardVideo = function() { - var res = this.plugin.JumpBackward(Config.skipDuration); - if (res == false) + var res = this.plugin.JumpBackward(Player.skipDuration); + if (res == false) { Display.showPopup("Jump Backward ret= " + ((res == true) ? "True" : "False")); + + } + }; +Player.adjustSkipDuration = function (dir) { + if (Player.isLive == true) { + return; + } + switch (dir) { + case 0: + // Reset + Player.skipDuration = Config.skipDuration; + Display.setSkipDuration(Player.skipDuration ); + break; + case 1: + // Increase + Player.skipDuration += Config.skipDuration; + Display.setSkipDuration(Player.skipDuration ); + break; + case 2: + // Decrease + Player.skipDuration -= Config.skipDuration; + if (Player.skipDuration < Config.skipDuration) + Player.skipDuration = Config.skipDuration; + Display.setSkipDuration(Player.skipDuration ); + break; + }; +}; + + Player.fastForwardVideo = function() { if (this.trickPlayDirection == 1) this.trickPlaySpeed = this.trickPlaySpeed * 2; diff --git a/smarttv-client/config.xml b/smarttv-client/config.xml index 3a5bc44..5f9c48f 100755 --- a/smarttv-client/config.xml +++ b/smarttv-client/config.xml @@ -9,7 +9,7 @@ Images/icon/SmartTvWeb_115.png Images/icon/SmartTvWeb_85.png Images/icon/SmartTvWeb_95.png - 0.81 + 0.82 y y diff --git a/smarttv-client/index.html b/smarttv-client/index.html index b4fea24..3f4660a 100755 --- a/smarttv-client/index.html +++ b/smarttv-client/index.html @@ -11,6 +11,8 @@ + + -- cgit v1.2.3