diff options
author | thlo <smarttv640@gmail.com> | 2013-08-27 22:08:08 +0200 |
---|---|---|
committer | thlo <t.lohmar@gmx.de> | 2013-08-27 22:08:08 +0200 |
commit | 611fd0079284be330812e9eb44a43304c42387fe (patch) | |
tree | 7884c091d5b94731781b1ff9be587b26c5131f0c /smarttv-client | |
parent | 616c3e41b03f39799abe0c9e27922a196fadf70d (diff) | |
download | vdr-plugin-smarttvweb-611fd0079284be330812e9eb44a43304c42387fe.tar.gz vdr-plugin-smarttvweb-611fd0079284be330812e9eb44a43304c42387fe.tar.bz2 |
New Overlay Menu for RecCmd Handling
Make YouTube entry optional (Select Screen option is configurable
through widget.conf)
First 3D iter function for 3D TVs and 3D BDs.
Diffstat (limited to 'smarttv-client')
-rw-r--r-- | smarttv-client/Javascript/Comm.js | 3 | ||||
-rwxr-xr-x | smarttv-client/Javascript/Config.js | 9 | ||||
-rwxr-xr-x | smarttv-client/Javascript/Data.js | 60 | ||||
-rwxr-xr-x | smarttv-client/Javascript/Display.js | 24 | ||||
-rwxr-xr-x | smarttv-client/Javascript/Main.js | 38 | ||||
-rw-r--r-- | smarttv-client/Javascript/OverlayMenu.js | 202 | ||||
-rwxr-xr-x | smarttv-client/Javascript/Player.js | 84 | ||||
-rw-r--r-- | smarttv-client/Javascript/SelectScreen.js | 145 | ||||
-rwxr-xr-x | smarttv-client/Javascript/Server.js | 58 | ||||
-rwxr-xr-x | smarttv-client/config.xml | 2 | ||||
-rwxr-xr-x | smarttv-client/index.html | 16 |
11 files changed, 577 insertions, 64 deletions
diff --git a/smarttv-client/Javascript/Comm.js b/smarttv-client/Javascript/Comm.js index eb548a2..b6e216f 100644 --- a/smarttv-client/Javascript/Comm.js +++ b/smarttv-client/Javascript/Comm.js @@ -147,7 +147,8 @@ Comm.onMessageReceived = function(message, context) { }
break;
case "MESG":
- Notify.showNotify(msg.payload, true);
+ if (msg.payload != "")
+ Notify.showNotify(msg.payload, true);
break;
}; // switch
diff --git a/smarttv-client/Javascript/Config.js b/smarttv-client/Javascript/Config.js index 2d4cf52..e32b74a 100755 --- a/smarttv-client/Javascript/Config.js +++ b/smarttv-client/Javascript/Config.js @@ -340,6 +340,7 @@ function VdrServers() { this.serverUrlList = [];
this.activeServers = [];
this.responses = 0;
+ this.retries = 0;
this.instanceName = "";
};
@@ -362,7 +363,13 @@ VdrServers.prototype.handleResponse = function () { Main.log ("handle responses: Done. Active Servers= " + this.activeServers.length);
switch (this.activeServers.length) {
case 0:
- Display.showPopup("Please start your VDR server");
+ this.retries ++;
+ if (this.retries <2) {
+ this.checkServers();
+ }
+ else
+ Display.showPopup("Please start your VDR server");
+
break;
case 1:
Config.serverAddr = this.activeServers[0].addr;
diff --git a/smarttv-client/Javascript/Data.js b/smarttv-client/Javascript/Data.js index d2673fe..7933de6 100755 --- a/smarttv-client/Javascript/Data.js +++ b/smarttv-client/Javascript/Data.js @@ -112,6 +112,66 @@ Data.getVideoCount = function() { Data.deleteElm = function (pos) {
Data.getCurrentItem().childs.remove(pos);
};
+
+//--------------------------------------------------
+//--------------------- RecCmds --------------------
+//--------------------------------------------------
+
+var RecCmds = {
+ cmds : new Item,
+ folderList : [],
+};
+
+RecCmds.reset = function() {
+ this.cmds = null;
+ this.cmds = new Item;
+ this.folderList = [];
+ Main.log("RecCmds.reset: folderList.push. this.folderList.length= " + this.folderList.length);
+};
+
+RecCmds.completed= function() {
+ this.folderList.push({item : this.cmds, id: 0});
+ Main.log("---------- completed ------------");
+ Main.log("RecCmds.completed: Data.folderList.length= " + this.folderList.length);
+};
+
+RecCmds.selectFolder = function (idx, first_idx) {
+ this.folderList.push({item : this.getCurrentItem().childs[idx], id: idx, first:first_idx});
+ Main.log("RecCmds.selectFolder: folderList.push. this.folderList.length= " + this.folderList.length);
+};
+
+RecCmds.folderUp = function () {
+ itm = this.folderList.pop();
+ Main.log("RecCmds.folderUp: folderList.pop. this.folderList.length= " + this.folderList.length);
+ return itm;
+};
+
+RecCmds.isRootFolder = function() {
+ Main.log("RecCmds.isRootFolder: this.folderList.length= " + this.folderList.length);
+ if (this.folderList.length == 1)
+ return true;
+ else
+ return false;
+};
+
+RecCmds.addItem = function(t_list, pyld) {
+ this.cmds.addChild(t_list, pyld, 0);
+};
+
+RecCmds.dumpFolderStruct = function(){
+ Main.log("---------- RecCmds.dumpFolderStruct ------------");
+ this.cmds.print(0);
+ Main.log("---------- RecCmds.dumpFolderStruct Done -------");
+};
+
+RecCmds.getCurrentItem = function () {
+ return this.folderList[this.folderList.length-1].item;
+};
+
+RecCmds.getVideoCount = function() {
+ return this.folderList[this.folderList.length-1].item.childs.length;
+};
+
//-----------------------------------------
function Item() {
this.title = "root";
diff --git a/smarttv-client/Javascript/Display.js b/smarttv-client/Javascript/Display.js index 1406970..a8eb758 100755 --- a/smarttv-client/Javascript/Display.js +++ b/smarttv-client/Javascript/Display.js @@ -62,6 +62,7 @@ Display.init = function() "overflow": "hidden", "text-overflow":"ellipsis", "white-space": "nowrap", "height": "14px"}));
}
+ /*
var done = false;
var i = 0;
@@ -77,6 +78,7 @@ Display.init = function() elm.style.marginBottom= " 5px";
elm.style.textAlign = "center";
}
+ */
Display.resetDescription();
Main.log("Display initialized" );
return success;
@@ -438,13 +440,6 @@ Display.handleDescription =function (selected) { d_str = hour + ":" + min;
-/* msg += title + "<br>";
- msg += "<b>"+ prog + "</b><br>";
- msg += "<br>Start: " + d_str + "<br>";
- msg += "Duration: " + Display.durationString(length) + "h<br>";
- msg += "Remaining: " + Display.durationString((itm.payload.start + length - now));
- msg += "<br><br>"+ desc;
- */
$("#descProg").show();
$("#descRemaining").show();
@@ -458,12 +453,6 @@ Display.handleDescription =function (selected) { break;
case Main.eREC:
d_str = mon + "/" + day + " " + hour + ":" + min;
-/*
- msg += "<b>" + title + "</b>";
- msg += "<br><br>" + d_str;
- msg += " Duration: " + Display.durationString(length) + "h";
- msg += "<br><br>"+ desc;
-*/
$("#descTitle").text(title);
$("#descStart").text("Start: " + d_str);
$("#descDuration").text("Duration: " + Display.durationString(length) + "h");
@@ -472,7 +461,7 @@ Display.handleDescription =function (selected) { $("#descImg").show();
$("#descImg")
.error(function() { $("#descImg").hide();})
- .attr('src', Data.getCurrentItem().childs[selected].payload.link + "/preview_vdr.png");
+ .attr('src', Data.getCurrentItem().childs[selected].payload.link + "/preview_vdr.png?"+Math.random());
break;
case Main.eMED:
@@ -563,13 +552,6 @@ Display.setVideoListPosition = function(position, move) { }
};
-/*
-Display.setDescription = function(description) {
- var descriptionElement = document.getElementById("description");
-
- Display.putInnerHTML(descriptionElement, description);
-};
-*/
Display.getDisplayTitle = function(item) {
var res = {c1:"", c2:"", c3:""};
switch (Main.state) {
diff --git a/smarttv-client/Javascript/Main.js b/smarttv-client/Javascript/Main.js index 241666c..e7c06ae 100755 --- a/smarttv-client/Javascript/Main.js +++ b/smarttv-client/Javascript/Main.js @@ -6,6 +6,7 @@ try { widgetAPI = new Common.API.Widget();
tvKey = new Common.API.TVKeyValue();
pluginObj = new Common.API.Plugin();
+
}
catch (e) {
}
@@ -96,8 +97,9 @@ Main.onLoad = function() { $.ajaxSetup ({
cache: false
});
+
Display.init();
- Display.selectItem(document.getElementById("selectItem1"));
+// Display.selectItem(document.getElementById("selectItem1"));
Notify.init();
Spinner.init();
Helpbar.init();
@@ -130,6 +132,8 @@ showHandler = function() { // Called by Config, when done
Main.init = function () {
+ Main.log("Main.init()");
+
if (Config.debug == true) {
Main.logToServer = function (msg) {
if (Config.serverUrl == "" )
@@ -142,9 +146,8 @@ Main.init = function () { }
this.state = Main.eMAIN;
+ SelectScreen.init();
- Main.log("Main.init()");
-
Buttons.init();
if ( Player.init() && Server.init() ) {
@@ -187,9 +190,14 @@ Main.init = function () { Comm.init();
-// window.setTimeout(function() {Config.updateContext("192.168.1.142:8000"); }, (10*1000));
-
+ Main.log("ProductInfo= " + deviceapis.tv.info.getProduct());
+ Main.logToServer("ProductInfo= " + deviceapis.tv.info.getProduct());
+ Main.logToServer("isBdPlayer= " + Main.isBdPlayer());
+ Main.logToServer("TimeZone= " + deviceapis.tv.info.getTimeZone());
+// TestHandler.showMenu(20);
+
+ // window.setTimeout(function() {Config.updateContext("192.168.1.142:8000"); }, (10*1000));
// DirectAccess.show();
// Timers.init();
@@ -248,6 +256,13 @@ Main.testUrls = function () { };
+Main.isBdPlayer = function () {
+ if (deviceapis.tv.info.getProduct() == 2) //deviceapis.tv.info.PRODUCT_TYPE_BD
+ return true;
+ else
+ return false;
+};
+
Main.changeState = function (state) {
Main.log("change state: OldState= " + this.state + " NewState= " + state);
var old_state = this.state;
@@ -843,6 +858,11 @@ cPlayStateKeyHndl.prototype.handleKeyDown = function (event) { case tvKey.KEY_YELLOW:
Player.nextSubtitleTrack();
break;
+ case 1089:
+ case tvKey.KEY_3D:
+ case tvKey.KEY_GREEN:
+ Player.toggle3DEffectMode();
+ break;
break;
default:
Main.log("Calling Default Key Hanlder");
@@ -1121,7 +1141,9 @@ cMenuKeyHndl.prototype.handleKeyDown = function (event) { }
break;
-
+ case tvKey.KEY_RED:
+ RecCmdHandler.showMenu(Data.getCurrentItem().childs[Main.selectedVideo].payload.guid);
+ break;
case tvKey.KEY_YELLOW:
if (Main.state == Main.eURLS) {
Buttons.ynShow();
@@ -1209,7 +1231,7 @@ cMenuKeyHndl.prototype.handleKeyDown = function (event) { }
};
-
+/*
//---------------------------------------------------
// Select Menu Key Handler
//---------------------------------------------------
@@ -1293,7 +1315,7 @@ cSelectMenuKeyHndl.prototype.handleKeyDown = function (event) { break;
}
};
-
+*/
//---------------------------------------------------
// Default Key Handler
diff --git a/smarttv-client/Javascript/OverlayMenu.js b/smarttv-client/Javascript/OverlayMenu.js index 14d237a..64a7eba 100644 --- a/smarttv-client/Javascript/OverlayMenu.js +++ b/smarttv-client/Javascript/OverlayMenu.js @@ -1,21 +1,18 @@ var OverlayMenu = {
- menu : []
+ menu : [],
+ scrollDur : 300,
+ scrollFlip : 100
};
OverlayMenu.init = function () {
- // initiate the overlay menue
-
- // should get an Array with Title and Command as input
-// OverlayMenu.menu.push ({title: "Teefax", func : undefined});
-// OverlayMenu.menu.push ({title: "Verleihnix", func : undefined});
-
+ // initiate the overlay menu
OverlayMenu.createStyleSheet();
-
this.elmName = "#olm-";
this.masterElm = "#overlayMenu";
this.inputElm = "#overlayMenu-anchor";
this.btnSelected = 0;
+ this.scrolling = false;
var elem = document.getElementById('overlayMenu-anchor');
elem.setAttribute('onkeydown', 'OverlayMenu.onInput();');
@@ -26,14 +23,16 @@ OverlayMenu.init = function () { OverlayMenu.show = function() {
Main.log("***** OverlayMenu.show *****");
+ this.scrolling = false;
OverlayMenu.createMenu();
// this.menuHandler.show();
Main.log("OverlayMenu.show(): masterElm= " +this.masterElm + " inputElm= " + this.inputElm);
$(this.masterElm).show();
+ OverlayMenu.tuneMenu();
+
$(this.inputElm).focus();
this.reset ();
-
};
OverlayMenu.hide = function() {
@@ -50,7 +49,7 @@ OverlayMenu.createStyleSheet = function () { var sheet = $("<style>");
sheet.attr({type : 'text/css',
innerHTML : '\
- #overlayMenu { width:40%; height: 30%; position: absolute; text-align:center; border-width:1px;\
+ #overlayMenu { width:40%; position: absolute; text-align:center; border-width:1px;\
background:rgba(0,0,139, 0.8);border-style:solid;border-width:1px;border-radius:15px;\
-webkit-box-shadow:3px 3px 7px 4px rgba(0,0,0, 0.5);z-index:50;}\
.ovl-itm { margin-left: 10px; \
@@ -73,7 +72,7 @@ OverlayMenu.createStyleSheet = function () { $('body').append(sheet);
};
-
+/*
OverlayMenu.createMenu= function () {
var p_width = $("body").outerWidth();
var p_height = $("body").outerHeight();
@@ -112,11 +111,67 @@ OverlayMenu.createEntry = function(name, id) { return row;
};
+*/
-OverlayMenu.createHelpbarRow = function() {
- var res = $("<tr>", {style: "width:100%; align:center"});
- var outer_cell = $("<td>", {style: "width:100%; align:center"});
+OverlayMenu.tuneMenu = function () {
+ var p_width = $("body").outerWidth();
+ var p_height = $("body").outerHeight();
+
+ var tgt = p_height * 0.6;
+
+ if ($("#overlayMenu").outerHeight() > tgt) {
+ this.scrolling = true;
+ var tgt_height_delta = ($("#overlayMenu").outerHeight() -tgt);
+ Main.log("tgt_height_delta= " + tgt_height_delta);
+ var tgt_height = $("#ovlBody").height() - tgt_height_delta;
+ Main.log("tgt_height= " + tgt_height);
+
+ $("#ovlBody").css({"height":tgt_height+"px"});
+ }
+ $("#overlayMenu").css({"left": ((p_width - $("#overlayMenu").outerWidth()) /2) +"px",
+ "top": ((p_height - $("#overlayMenu").outerHeight()) /2) +"px"});
+
+ Main.log("ovlOuterHeight=" + $("#overlayMenu").outerHeight() );
+ Main.log("ovlBodyOuterHeight=" + $("#ovlBody").outerHeight() );
+
+};
+
+OverlayMenu.createMenu= function () {
+ var p_width = $("body").outerWidth();
+ var p_height = $("body").outerHeight();
+
+ var table = $("<div>", {style:"height:100%;width:100%;", id:"ovlTable"});
+ $("#overlayMenu").append(table);
+// var table = $("overlayMenu");
+
+ var tbody = $("<div>", {style:"width:100%;overflow-y: scroll;margin-top:3px;", id:"ovlBody"});
+ for (var i = 0; i < OverlayMenu.menu.length; i++) {
+ var row = OverlayMenu.createEntry(OverlayMenu.menu[i].title, i);
+ tbody.append(row);
+ }
+
+ table.append(tbody);
+
+ var row = OverlayMenu.createHelpbarRow();
+ table.append(row);
+
+ $("#overlayMenu").css({"left": ((p_width - $("#overlayMenu").outerWidth()) /2) +"px",
+ "top": ((p_height - $("#overlayMenu").outerHeight()) /2) +"px"});
+
+};
+
+
+OverlayMenu.createEntry = function(name, id) {
+ var cell = $("<div>", {style: "width:100%; align:center;"});
+ Main.log("OverlayMenu.createEntry: " +"olm-"+id);
+ $("<button>", {id : "olm-"+id, text: name, class: "ovl-itm"}).appendTo(cell);
+ return cell;
+};
+OverlayMenu.createHelpbarRow = function() {
+// var res = $("<tr>", {style: "width:100%; align:center"});
+// var outer_cell = $("<td>", {style: "width:100%; align:center"});
+ var outer_cell = $("<div>", {style: "width:100%; align:center"});
var h_table = $("<table>", {style:"height:100%;width:100%;"});
var tbody = $("<tbody>", {style:"height:100%;width:100%;"});
@@ -133,9 +188,9 @@ OverlayMenu.createHelpbarRow = function() { row.append(cell);
outer_cell.append(h_table);
- res.append(outer_cell);
-
- return res;
+ return outer_cell;
+// res.append(outer_cell);
+// return res;
};
OverlayMenu.createHelpItem = function(url, msg) {
@@ -167,21 +222,54 @@ OverlayMenu.selectBtnUp = function () { var btnname = this.elmName+this.btnSelected;
Main.log(this.hndlName + "-BtnLeft: Old: " +this.btnSelected + " btn= "+btnname);
$(btnname).removeClass('ovlmn-itm-selected').addClass('ovl-itm');
- if (this.btnSelected == 0)
+ if (this.btnSelected == 0) {
this.btnSelected = (OverlayMenu.menu.length-1);
- else
+// $("#ovlBody").scrollTop($(this.elmName + this.btnSelected).parent().position().top);
+ $("#ovlBody").animate ({scrollTop: $(this.elmName + this.btnSelected).parent().position().top}, this.scrollFlip);
+
+ }
+ else {
this.btnSelected--;
+ if (this.scrolling) {
+ var pos = $(this.elmName + this.btnSelected).parent().position().top;
+ Main.log("pos= " + pos + " ovlBodyHeight= " + $("#ovlBody").height() + " scrollTop= " + $("#ovlBody").scrollTop());
+ if (pos < 0) {
+// $("#ovlBody").scrollTop($("#ovlBody").scrollTop() + pos);
+ $("#ovlBody").animate ({scrollTop: $("#ovlBody").scrollTop() + pos}, this.scrollDur);
+ Main.log("New scrollTop= " +$("#ovlBody").scrollTop() +" new pos= " + $(this.elmName + this.btnSelected).parent().position().top);
+ }
+ }
+ }
$(this.elmName + this.btnSelected).removeClass('ovl-itm').addClass('ovlmn-itm-selected');
Main.log(this.hndlName+"-BtnUp: New: " +this.btnSelected);
};
OverlayMenu.selectBtnDown = function () {
$(this.elmName + this.btnSelected).removeClass('ovlmn-itm-selected').addClass('ovl-itm');
- if (this.btnSelected == (OverlayMenu.menu.length-1))
+ if (this.btnSelected == (OverlayMenu.menu.length-1)) {
this.btnSelected = 0;
- else
+ if (this.scrolling)
+// $("#ovlBody").scrollTop(0);
+ $("#ovlBody").animate ({scrollTop: 0}, this.scrollFlip);
+ }
+ else {
this.btnSelected++;
+ if (this.scrolling) {
+ var pos = $(this.elmName + this.btnSelected).parent().position().top;
+ var height = $(this.elmName + this.btnSelected).parent().height();
+ Main.log("pos= " + pos + " height= " + height + " ovlBodyHeight= " + $("#ovlBody").height() + " scrollTop= " + $("#ovlBody").scrollTop());
+ if ((pos + height) > $("#ovlBody").height()) {
+ $("#ovlBody").animate ({scrollTop: $("#ovlBody").scrollTop() + (pos + height) - $("#ovlBody").height()}, this.scrollDur);
+// $("#ovlBody").scrollTop($("#ovlBody").scrollTop() + (pos + height) - $("#ovlBody").height());
+ Main.log("New scrollTop= " +$("#ovlBody").scrollTop() +" new pos= " + $(this.elmName + this.btnSelected).parent().position().top);
+ }
+
+ }
+ }
+
$(this.elmName + this.btnSelected).removeClass('ovl-itm').addClass('ovlmn-itm-selected');
+
+
};
OverlayMenu.onInput = function () {
@@ -213,6 +301,76 @@ OverlayMenu.onInput = function () { }
widgetAPI.blockNavigation(event);
- };
+};
+
+//-----------------------------------------------------------------------
+var TestHandler = {
+
+};
+
+TestHandler.showMenu = function (no) {
+ OverlayMenu.reset();
+ OverlayMenu.menu = [];
+
+ for (var i = 0; i < no; i++) {
+ var self = this;
+ OverlayMenu.menu.push ({title: ("Test Title " +i), func : function (idx) { self.selectCallback(idx); } });
+ }
+
+ OverlayMenu.show();
+};
+
+TestHandler.selectCallback = function (idx) {
+ Main.log("TestHandler.selectCallback idx= " + idx );
+};
+
+//-----------------------------------------------------------------------
+var RecCmdHandler = {
+ guid : ""
+};
+
+
+RecCmdHandler.showMenu = function (guid) {
+ this.guid = guid;
+ RecCmds.reset();
+ Server.fetchRecCmdsList(); // calls RecCmdHandler.createRecCmdOverlay() when finished
+ OverlayMenu.reset();
+ OverlayMenu.menu = [];
+};
+
+RecCmdHandler.fillMenuArray = function () {
+ for (var i = 0; i < RecCmds.getVideoCount(); i++) {
+ var self = this;
+ OverlayMenu.menu.push ({title: RecCmds.getCurrentItem().childs[i].title, func : function (idx) { self.selectCallback(idx); } });
+ }
+};
+RecCmdHandler.createRecCmdOverlay = function () {
+ //called, when Server.fetchRecCmdsList() is finished.
+ Main.log("RecCmdHandler.createRecCmdOverlay for guid " + RecCmdHandler.guid);
+ Main.logToServer("RecCmdHandler.createRecCmdOverlay for guid " + RecCmdHandler.guid);
+ if (RecCmds.getVideoCount()== 0) {
+ Main.log("RecCmdHandler.createRecCmdOverlay: RecCmds is empty" );
+ Main.logToServer("RecCmdHandler.createRecCmdOverlay: RecCmds is empty" );
+ return;
+ }
+ RecCmdHandler.fillMenuArray();
+ OverlayMenu.show();
+};
+
+RecCmdHandler.selectCallback = function (idx) {
+ Main.logToServer("RecCmdHandler.selectCallback idx= " + idx + " t= " + RecCmds.getCurrentItem().childs[idx].title);
+ if (RecCmds.getCurrentItem().childs[idx].isFolder == true) {
+ Main.logToServer("RecCmdHandler.selectCallback isFolder");
+ RecCmds.selectFolder(idx, 0);
+
+ OverlayMenu.reset();
+ OverlayMenu.menu = [];
+ RecCmdHandler.fillMenuArray();
+ }
+ else {
+ Main.logToServer("RecCmdHandler.selectCallback idx= " + idx + " cmd= " + RecCmds.getCurrentItem().childs[idx].payload.cmd);
+ Server.execRecCmd(RecCmds.getCurrentItem().childs[idx].payload.cmd, RecCmdHandler.guid);
+ }
+};
diff --git a/smarttv-client/Javascript/Player.js b/smarttv-client/Javascript/Player.js index dc677eb..a21c933 100755 --- a/smarttv-client/Javascript/Player.js +++ b/smarttv-client/Javascript/Player.js @@ -6,6 +6,7 @@ var mainPlayer; var Player =
{
AVPlayerObj : null,
+ screenObj : null,
isLive : false,
isRecording : false,
mFormat : 0,
@@ -48,6 +49,7 @@ var Player = FORWARD : 3,
REWIND : 4,
+ effectMode : 0, // 3DEffect Mode value (range from 0 to 7)
aspectRatio :0,
eASP16to9 :0,
@@ -59,7 +61,7 @@ var Player = };
Player.init = function() {
-
+ this.screenObj = document.getElementById('pluginObjectScreen');
if (this.AVPlayerObj != null)
return false; // that prevents Main.init to overwrite the callbacks.
@@ -93,6 +95,8 @@ Player.resetAtStop = function () { return;
}
this.aspectRatio = this.eASP16to9;
+ this.effectMode = 0;
+
this.bufferState = 0;
Player.ResetTrickPlay(); // is the GUI resetted as well?
@@ -138,6 +142,84 @@ Player.toggleAspectRatio = function () { Player.setFullscreen();
};
+Player.toggle3DEffectMode = function () {
+ Main.logToServer("Player.toggle3DEffectMode");
+ if (Main.isBdPlayer() == true) {
+ if( 1 == Player.screenObj.Flag3DTVConnect() ) {
+ Main.logToServer("BDPlayer connected to 3D TV");
+ Player.setNew3DEffectMode();
+
+ }
+ else {
+ Main.logToServer("BDPlayer connected to 2D TV");
+ Notify.showNotify("No 3DTV connected, sorry", true);
+
+ }
+ }
+ else {
+ if( 1 == Player.screenObj.Flag3DEffectSupport() ) {
+ Main.logToServer("3D TV!");
+ Player.setNew3DEffectMode();
+ }
+ else {
+ Main.logToServer("2D TV..;-(");
+ Notify.showNotify("No 3DTV, sorry", true);
+ }
+ }
+};
+
+Player.setNew3DEffectMode = function () {
+ this.effectMode ++;
+ if (this.effectMode > 7)
+ this.effectMode = 0;
+
+ Main.logToServer("New 3D Effect effectMode= " + this.effectMode );
+ Player.screenObj.Set3DEffectMode(this.effectMode);
+
+/* if( 2 == Player.screenObj.Get3DEffectMode() ) {
+ Player.screenObj.Set3DEffectMode(0);
+ }
+ else {
+ Player.screenObj.Set3DEffectMode(2);
+ };
+ */
+
+ var mode = Player.screenObj.Get3DEffectMode();
+
+ Main.logToServer("New 3D Effect effectMode= " + this.effectMode + " plgMode= " + mode);
+// switch (Player.screenObj.Get3DEffectMode()) {
+ if (this.effectMode == mode ) {
+ switch (this.effectMode) {
+ case 0:
+ Notify.showNotify("3D Off", true);
+ break;
+ case 1:
+ Notify.showNotify("3D Top Bottom", true);
+ break;
+ case 2:
+ Notify.showNotify("3D Side-By-Side", true);
+ break;
+ case 3:
+ Notify.showNotify("3D Line-by-Line", true);
+ break;
+ case 4:
+ Notify.showNotify("3D Vertical Stripe", true);
+ break;
+ case 5:
+ Notify.showNotify("3D Mode frame sequence", true);
+ break;
+ case 6:
+ Notify.showNotify("3D Checker BD", true);
+ break;
+ case 7:
+ Notify.showNotify("3D: 2D to 3D", true);
+ break;
+ }
+ }
+ else {
+ Notify.showNotify("3D Issue Wanted= " + this.effectMode + " but got= " + mode +"!!!!", true);
+ }
+};
Player.setWindow = function() {
// this.plugin.SetDisplayArea(458, 58, 472, 270);
diff --git a/smarttv-client/Javascript/SelectScreen.js b/smarttv-client/Javascript/SelectScreen.js new file mode 100644 index 0000000..2d985c6 --- /dev/null +++ b/smarttv-client/Javascript/SelectScreen.js @@ -0,0 +1,145 @@ +var SelectScreen = {
+ keyToStateMap : []
+};
+
+
+SelectScreen.init = function() {
+ Main.log("SelectScreen.init");
+ Main.logToServer("Config.getWidgetVersion= " + Config.widgetVersion) ;
+ var parent = $("#selectView");
+ var idx = 0;
+
+ this.keyToStateMap[idx] = Main.eMAIN;
+ this.keyToStateMap[++idx] = Main.eLIVE;
+ parent.append($("<div>", {id : "selectItem"+idx, text:idx+": Live", style : "padding-bottom:3px; margin-top:5px; margin-bottom : 5px; text-align: center"}));
+
+ this.keyToStateMap[++idx] = Main.eREC;
+ parent.append($("<div>", {id : "selectItem"+idx, text:idx+": Recordings", style : "padding-bottom:3px; margin-top:5px; margin-bottom : 5px; text-align: center"}));
+
+ this.keyToStateMap[++idx] = Main.eMED;
+ parent.append($("<div>", {id : "selectItem"+idx, text:idx+": Media", style : "padding-bottom:3px; margin-top:5px; margin-bottom : 5px; text-align: center"}));
+
+ if (Config.haveYouTube) {
+ this.keyToStateMap[++idx] = Main.eURLS;
+ parent.append($("<div>", {id : "selectItem"+idx, text:idx+": You Tube", style : "padding-bottom:3px; margin-top:5px; margin-bottom : 5px; text-align: center"}));
+ selectMenuKeyHndl.selectMax++;
+ }
+
+ this.keyToStateMap[++idx] = Main.eSRVR;
+ parent.append($("<div>", {id : "selectItem"+idx, text:idx+": Select Server", style : "padding-bottom:3px; margin-top:5px; margin-bottom : 5px; text-align: center"}));
+ this.keyToStateMap[++idx] = Main.eOPT;
+ parent.append($("<div>", {id : "selectItem"+idx, text:idx+": Options", style : "padding-bottom:3px; margin-top:5px; margin-bottom : 5px; text-align: center"}));
+
+/*
+ var done = false;
+ var i = 0;
+
+ while (done != true) {
+ i ++;
+ var elm = document.getElementById("selectItem"+i);
+// var elm = $("#selectItem"+i);
+ if (elm == null) {
+ done = true;
+ break;
+ }
+ Main.log("found " + i);
+ elm.style.paddingBottom = "3px";
+ elm.style.marginTop= " 5px";
+ elm.style.marginBottom= " 5px";
+ elm.style.textAlign = "center";
+
+ }
+*/
+ Display.selectItem(document.getElementById("selectItem1"));
+// Display.jqSelectItem($("#selectItem1"));
+ Main.log("SelectScreen.init - done");
+
+};
+
+SelectScreen.keyToState = function (key) {
+
+};
+//---------------------------------------------------
+//Select Menu Key Handler
+//---------------------------------------------------
+function cSelectMenuKeyHndl (def_hndl) {
+ this.defaultKeyHandler = def_hndl;
+ this.handlerName = "SelectMenuKeyHandler";
+ Main.log(this.handlerName + " created");
+
+ this.select = 1;
+ this.selectMax = 5; // Highest Select Entry
+// this.selectMax = 6; // Highest Select Entry
+};
+
+cSelectMenuKeyHndl.prototype.handleKeyDown = function (event) {
+ var keyCode = event.keyCode;
+ Main.log(this.handlerName+": Key pressed: " + Main.getKeyCode(keyCode));
+
+ switch(keyCode) {
+ case tvKey.KEY_1:
+ Main.log("KEY_1 pressed");
+ this.select = 1;
+ Main.changeState (SelectScreen.keyToStateMap[this.select]);
+ break;
+ case tvKey.KEY_2:
+ Main.log("KEY_2 pressed");
+ this.select = 2;
+ Main.changeState (SelectScreen.keyToStateMap[this.select]);
+
+ break;
+ case tvKey.KEY_3:
+ Main.log("KEY_3 pressed");
+ this.select = 3;
+ Main.changeState (SelectScreen.keyToStateMap[this.select]);
+
+ break;
+ case tvKey.KEY_4:
+ Main.log("KEY_4 pressed");
+ this.select = 4;
+ Main.changeState (SelectScreen.keyToStateMap[this.select]);
+ break;
+
+ case tvKey.KEY_5:
+ Main.log("KEY_5 pressed");
+ this.select = 5;
+ Main.changeState (SelectScreen.keyToStateMap[this.select]);
+ break;
+
+ case tvKey.KEY_6:
+ Main.log("KEY_6 pressed");
+ this.select = 6;
+ Main.changeState (SelectScreen.keyToStateMap[this.select]);
+ break;
+
+ case tvKey.KEY_ENTER:
+ case tvKey.KEY_PLAY:
+ case tvKey.KEY_PANEL_ENTER:
+ Main.log("ENTER");
+ Main.log ("CurSelect= " + this.select + " State= " + SelectScreen.keyToStateMap[this.select]);
+
+ Main.changeState (SelectScreen.keyToStateMap[this.select]);
+
+ break; //thlo: correct?
+ case tvKey.KEY_DOWN:
+ Display.unselectItem(document.getElementById("selectItem"+this.select));
+ if (++this.select > this.selectMax)
+ this.select = 1;
+ Display.selectItem(document.getElementById("selectItem"+this.select));
+ Main.log("DOWN " +this.select);
+ break;
+
+ case tvKey.KEY_UP:
+ Display.unselectItem(document.getElementById("selectItem"+this.select));
+
+ if (--this.select < 1)
+ this.select = this.selectMax;
+ Display.selectItem(document.getElementById("selectItem"+this.select));
+
+ Main.log("UP "+ this.select);
+ break;
+ default:
+ this.defaultKeyHandler.handleDefKeyDown(keyCode);
+ break;
+ }
+};
diff --git a/smarttv-client/Javascript/Server.js b/smarttv-client/Javascript/Server.js index 660230a..8c696b7 100755 --- a/smarttv-client/Javascript/Server.js +++ b/smarttv-client/Javascript/Server.js @@ -175,7 +175,7 @@ Server.updateVdrStatus = function (){ // if Config.tzCorrection larger zero, then TV is ahead
// thus, I need to substract Config.tzCorrection from the TV time
// Config.tzCorrection = 1;
- Main.logToServer("Server.updateVdrStatu: tzCor= " + Config.tzCorrection);
+ Main.logToServer("Server.updateVdrStatus: tzCor= " + Config.tzCorrection);
}
else
Main.logToServer("tzCor WARNING");
@@ -319,6 +319,62 @@ Server.notifyServer = function (state) { });
};
+Server.fetchRecCmdsList = function() {
+ var url = Config.serverUrl + "/reccmds.xml";
+ $.ajax({
+ url: url,
+ type : "GET",
+ success : function(data, status, XHR ) {
+ Main.logToServer("Server.fetchRecCmdsList Success Response - status= " + status + " mime= " + XHR.responseType + " data= "+ data);
+
+ $(data).find("item").each(function () {
+ var title = $(this).text();
+ var confirm = (($(this).attr("confirm") == "true") ? true : false);
+ var cmd = parseInt($(this).attr("cmd"));
+
+ var title_list = title.split("~");
+ RecCmds.addItem( title_list, {cmd : cmd, confirm: confirm });
+ }); // each
+
+/* if (Server.dataReceivedCallback) {
+ Server.dataReceivedCallback();
+ }
+*/
+// RecCmds.dumpFolderStruct();
+ RecCmds.completed();
+ RecCmdHandler.createRecCmdOverlay();
+ },
+ error : function (jqXHR, status, error) {
+ Main.logToServer("Server.fetchRecCmdsList Error Response - status= " + status + " error= "+ error);
+ Display.showPopup("Error with XML File: " + status);
+ },
+ parsererror : function () {
+ Main.logToServer("Server.fetchRecCmdsList parserError " );
+ Display.showPopup("Error in XML File");
+/* if (Server.errorCallback != null) {
+ Server.errorCallback("XmlError");
+ }
+*/
+ }
+ });
+};
+
+Server.execRecCmd = function (cmd, guid) {
+ var url = Config.serverUrl + "/execreccmd?cmd="+cmd+"&guid=" + guid;
+
+ Main.logToServer("Server.execRecCmd cmd="+cmd+" guid=" + guid + " url= " + url);
+ $.ajax({
+ url: url,
+ type : "GET",
+ success : function(data, status, XHR ) {
+ Main.logToServer("Server.execRecCmd OK" ) ;
+ Display.handleDescription(Main.selectedVideo);
+ },
+ error : function (XHR, status, error) {
+ Main.logToServer("Server.execRecCmd failed" ) ;
+ }
+ });
+};
var HeartbeatHandler = {
timeoutObj : null,
diff --git a/smarttv-client/config.xml b/smarttv-client/config.xml index 056a2bd..85c7537 100755 --- a/smarttv-client/config.xml +++ b/smarttv-client/config.xml @@ -9,7 +9,7 @@ <BigThumbIcon>Images/icon/SmartTvWeb_115.png</BigThumbIcon>
<ListIcon>Images/icon/SmartTvWeb_85.png</ListIcon>
<BigListIcon>Images/icon/SmartTvWeb_95.png</BigListIcon>
- <ver>0.95.0730</ver>
+ <ver>0.95.0827</ver>
<mgrver></mgrver>
<fullwidget>y</fullwidget>
<movie>y</movie>
diff --git a/smarttv-client/index.html b/smarttv-client/index.html index e09df5d..3ec5c46 100755 --- a/smarttv-client/index.html +++ b/smarttv-client/index.html @@ -16,6 +16,7 @@ <script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/Util/Include.js"></script>
<script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/Util/Language.js"></script>
<script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/Plugin/Define.js"></script>
+ <script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/deviceapis.js"></script>
<script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/webapis.js"></script>
<!-- Widget code -->
@@ -39,6 +40,7 @@ <script language="javascript" type="text/javascript" src="Javascript/Urls.js"></script>
<script language="javascript" type="text/javascript" src="Javascript/Comm.js"></script>
<script language="javascript" type="text/javascript" src="Javascript/OverlayMenu.js"></script>
+ <script language="javascript" type="text/javascript" src="Javascript/SelectScreen.js"></script>
<!-- Style sheets -->
<link rel="stylesheet" href="CSS/Main.css" type="text/css">
@@ -49,14 +51,18 @@ <!-- <object id="pluginAudio" border=0 classid="clsid:SAMSUNG-INFOLINK-AUDIO"></object>-->
<object id="pluginTime" border=0 classid="clsid:SAMSUNG-INFOLINK-TIME"></object>
<object id="pluginObjectTVMW" border=0 classid="clsid:SAMSUNG-INFOLINK-TVMW"></object>
- <object id="pluginObjectVideo" border=0 classid="clsid:SAMSUNG-INFOLINK-VIDEO"></object>
+ <object id="pluginObjectVideo" border=0 classid="clsid:SAMSUNG-INFOLINK-VIDEO"></object>
+ <object id="pluginObjectScreen" classid="clsid:SAMSUNG-INFOLINK-SCREEN"></object>
<object id="pluginObjectNNavi" border=0 classid="clsid:SAMSUNG-INFOLINK-NNAVI"></object>
<object id="pluginObjectAppCommon" border=0 classid="clsid:SAMSUNG-INFOLINK-APPCOMMON"></object>
<object id="pluginNetwork" border=0 classid="clsid:SAMSUNG-INFOLINK-NETWORK"></object>
<object id="pluginTaskmgnt" border=0 classid="clsid:SAMSUNG-INFOLINK-TASKMANAGER"></object>
-
+<!-- <object id="pluginSef" border="0" classid="clsid:SAMSUNG-INFOLINK-SEF"
+ style="opacity:0.0; background-color:#000000; width:300px; height:100px;">
+ </object>
+-->
</head>
@@ -84,12 +90,6 @@ <td id="selectDisk">Free: 1Gb</td>
</tr>
</table>
- <div id="selectItem1">1: Live</div>
- <div id="selectItem2">2: Recordings</div>
- <div id="selectItem3">3: Media</div>
- <div id="selectItem4">4: YouTube</div>
- <div id="selectItem5">5: Select Server</div>
- <div id="selectItem6">6: Options</div>
</div>
</div>
<div id="optionsScreen">
|