From 3488d6aa8a59441491cd876f7121d4d2cdb7913c Mon Sep 17 00:00:00 2001 From: thlo Date: Sun, 3 Feb 2013 20:36:52 +0100 Subject: 4:3 Button. Trickplay for PES recordings and other files (no TS recordings yet). Delete Recordings. Parsing RSS enclosure url. --- smarttv-client/CSS/Main.css | 24 ++- smarttv-client/Javascript/Buttons.js | 349 ++++++++++++++++++++++++++--------- smarttv-client/Javascript/Data.js | 10 +- smarttv-client/Javascript/Display.js | 20 +- smarttv-client/Javascript/Main.js | 129 +++++++++---- smarttv-client/Javascript/Notify.js | 28 +++ smarttv-client/Javascript/Player.js | 161 ++++++++++++---- smarttv-client/Javascript/Server.js | 138 ++++++++++---- smarttv-client/config.xml | 2 +- smarttv-client/index.html | 18 +- 10 files changed, 684 insertions(+), 195 deletions(-) create mode 100644 smarttv-client/Javascript/Notify.js (limited to 'smarttv-client') diff --git a/smarttv-client/CSS/Main.css b/smarttv-client/CSS/Main.css index cb6ac5e..5b8f829 100755 --- a/smarttv-client/CSS/Main.css +++ b/smarttv-client/CSS/Main.css @@ -42,8 +42,9 @@ body { left: 0px; top: 0px; width: 960px; height: 540px; background: url("../Images/selectScreen-bg.png"); + background: radial-gradient(ellipse at 80% 80%, #c5deea 0%,#8abbd7 31%,#066dab 100%); background: -webkit-radial-gradient(80% 80%, ellipse cover, rgba(197,222,234,1) 0%,rgba(138,187,215,1) 31%,rgba(6,109,171,1) 100%); -} + } #selectView { position: absolute; @@ -52,11 +53,13 @@ body { border-style:solid; border-width:2px; font-size:16px; + border-radius: 7px; -webkit-border-radius: 7px; padding-top:5px; padding-left:20px; padding-right:20px; background: rgba(6,109,171,1) 100%; + background: linear-gradient(135deg, #1e5799 0%,#2989d8 41%,#7db9e8 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); } @@ -111,6 +114,25 @@ body { background-color: rgba(0,0,0,0.5); } +#notify { + position: absolute; + display: none; + left: 70%; top: 10px; + width: 20%; height: 6%; + -webkit-border-radius: 1em; + -webkit-box-shadow:3px 3px 7px 4px rgba(0,0,0, 0.5); + border-style:solid; + border-width:2px; + font-size:16px; + + padding-top:20px; + padding-left:20px; + padding-right:20px; + background-color: rgba(0,0,0,0.5); + z-index:20; + +} + #popup{ position: absolute; display: none; diff --git a/smarttv-client/Javascript/Buttons.js b/smarttv-client/Javascript/Buttons.js index 8edab38..5c5b3ca 100644 --- a/smarttv-client/Javascript/Buttons.js +++ b/smarttv-client/Javascript/Buttons.js @@ -1,7 +1,8 @@ var Buttons = { created: false, btnSelected : 0, - btnMax : 1 + btnMax : 2, + prButton : null }; /* @@ -9,94 +10,237 @@ var Buttons = { */ Buttons.init = function (){ if (this.created == false) { - Buttons.createButtons(); - $("#pr-popup").hide(); + Buttons.createStyleSheet (); + Buttons.createPrcButtons(); + $("#prc-buttons").hide(); + Buttons.createYnButtons(); + $("#yn-buttons").hide(); + this.created = true; - } + this.prButton = new ButtonHandler(); + this.prButton.hndlName = "prcButtons"; + this.prButton.enterCallback = Buttons.prcEnterCallback; + this.prButton.btnMax = 2; + this.prButton.elmName = "#pr-btn-"; + this.prButton.masterElm = "#prc-buttons"; + this.prButton.inputElm = "#prc-buttons-anchor"; + + var elem = document.getElementById('prc-buttons-anchor'); + elem.setAttribute('onkeydown', 'Buttons.prButton.onInput();'); + + this.ynButton = new ButtonHandler(); + this.ynButton.hndlName = "ynButtons"; + this.ynButton.enterCallback = Buttons.ynEnterCallback; + this.ynButton.btnMax = 1; + this.ynButton.elmName = "#yn-btn-"; + this.ynButton.masterElm = "#yn-buttons"; + this.ynButton.inputElm = "#yn-buttons-anchor"; + + elem = document.getElementById('yn-buttons-anchor'); + elem.setAttribute('onkeydown', 'Buttons.ynButton.onInput();'); + // $("#prc-buttons-anchor").attr("onkeydown", "Button.prButton.onInput();"); + } +}; + +Buttons.ynEnterCallback = function () { + Main.log("Buttons.ynEnterCallback btnSelected= " + Buttons.ynButton.btnSelected); + switch(Buttons.ynButton.btnSelected){ + case 0: + Main.logToServer("ynButtons: No -> Don't delete"); + break; + case 1: + Main.logToServer("ynButtons: Yes "+Player.resumePos); + Server.deleteRecording(Player.guid); + break; + } + Buttons.ynHide(); + }; + +Buttons.prcEnterCallback = function () { + Main.log("Buttons.prcEnterCallback"); + + switch(Buttons.prButton.btnSelected){ + case 0: + Main.logToServer("prcButtons: Play from start"); + Display.hide(); + Display.showProgress(); + Player.playVideo(-1); + Buttons.prcHide(); + break; + case 1: + Main.logToServer("prcButtons: Resume from "+Player.resumePos); +// Player.playVideo(Player.resumePos); + Display.hide(); + Display.showProgress(); + Spinner.show(); + Server.getResume(Player.guid); + Buttons.prcHide(); + break; + case 2: + //delete + Buttons.prcHide(); + Buttons.ynShow(); + + break; + } }; Buttons.show = function () { Main.log("Buttons.show()"); - $("#pr-popup").show(); - $("#pr-popup-anchor").focus(); - - Buttons.reset (); + this.prButton.show(); + this.prButton.reset(); }; - Buttons.hide = function () { - $("#pr-popup").hide(); - $("#pr-popup-anchor").blur(); + this.prButton.hide(); +// $("#prc-buttons-anchor").blur(); Main.enableKeys(); }; -Buttons.createButtons= function () { - var p_width = $("body").outerWidth(); - var p_height = $("body").outerHeight(); - +Buttons.prcShow = function () { + Main.log("Buttons.show()"); + this.prButton.show(); + this.prButton.reset(); +}; + +Buttons.prcHide = function () { + this.prButton.hide(); +// $("#prc-buttons-anchor").blur(); + Main.enableKeys(); +}; + +Buttons.ynShow = function () { + Main.log("Buttons.ynShow()"); + this.ynButton.show(); + this.ynButton.reset(); +}; + +Buttons.ynHide = function () { + this.ynButton.hide(); + Main.enableKeys(); +}; + +Buttons.createStyleSheet = function () { var sheet = $("