From 4fd1762d4b44f38bb06615d9b9aa72a2549cd2a0 Mon Sep 17 00:00:00 2001 From: Paul Kim Date: Tue, 14 Feb 2023 18:16:55 +0900 Subject: [PATCH] =?UTF-8?q?issue=20#7=20#10=20NETFLIX,YOUTUBE=EC=8B=A4?= =?UTF-8?q?=ED=96=89=EC=8B=9C=20=ED=95=9C=EA=B8=80=20=EB=B0=8F=20=EC=98=81?= =?UTF-8?q?=EB=AC=B8=EC=9C=BC=EB=A1=9C=20=EA=B5=AC=EB=8F=99=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95.=20YOUTUBE=EB=B0=8F=20N?= =?UTF-8?q?ETFLIX=EC=A2=85=EB=A3=8C=EC=8B=9C=20TV=20OSD=EC=B6=9C=EB=A0=A5?= =?UTF-8?q?=20=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- procentric/application/lib/hoteltv.hcap.js | 40 +++++++++++++++++++ procentric/application/lib/hoteltv.js | 31 +++++--------- .../application/lib/hoteltv.ui_welcome.js | 34 ++++++++++++---- 3 files changed, 77 insertions(+), 28 deletions(-) diff --git a/procentric/application/lib/hoteltv.hcap.js b/procentric/application/lib/hoteltv.hcap.js index e9e0384..639b354 100755 --- a/procentric/application/lib/hoteltv.hcap.js +++ b/procentric/application/lib/hoteltv.hcap.js @@ -38,6 +38,7 @@ HotelTV.hcap = (function() { 'input_splash_image', 'block_usb', 'tv_channel_attribute_floating_ui', 'instant_power', 'hardware_version', 'network_info', + 'tv_channel_ui', 'soft_ap_ui', "soft_ap", "soft_ap_password", 'end_of_item' ]; @@ -183,6 +184,21 @@ HotelTV.hcap = (function() { }); }; + /** + * HCAP Wrapper Function::> Get Device Locale List + * @param {string} sz_key property key name. + * @param {callback} callback is callback object + */ + function __hcapfxn_get_dev_locale_info(sz_key, callback) { + return new Promise((resolve, reject) => { + let param = { + "onSuccess": function(p) { resolve({ "key": sz_key, "info": p }) }, + "onFailure": function(f) { resolve({ "key": sz_key, "info": null }); } + } + hcap.system.getLocaleList(param); + }); + }; + /** * HCAP Wrapper Function::> Get ProCentric Server Info(Realted HCAP API:hcap.system.getProcentricServer) * @param {string} sz_key property key name. @@ -585,6 +601,10 @@ HotelTV.hcap = (function() { } //console.log(`Item[${_dic_item.key}] ::> ${_dic_item.value}`); }; + //Locale Information + __hcapfxn_get_dev_locale_info("getLocaleList").then(result => { + _devinfo['getLocaleList'] = result.info.list; + }); //Server Information __hcapfxn_get_pctrsvrinfo("pro_centric_server_info").then(result => { @@ -1018,6 +1038,13 @@ HotelTV.hcap = (function() { } } + // TV CHANNEL UI + if (_devinfo["tv_channel_ui"] !== undefined) { + if (_devinfo["tv_channel_ui"] != 0) { + _pmFxnArProperty.push(__hcapfxn_set_property('tv_channel_ui', 0)); + } + } + // // OSD LAYER ID // if (_devinfo["osd_layer_id"] !== undefined) { // if (_devinfo["osd_layer_id"] != 0) { @@ -1511,6 +1538,19 @@ HotelTV.hcap = (function() { }); }, + SetDeviceLocale: function(_new_locale) { + hcap.system.requestLocaleChange({ + "specifier" : _new_locale, + "onSuccess" : function() { + console.log("onSuccess"); + }, + "onFailure" : function(f) { + console.error("onFailure : errorMessage = " + f.errorMessage); + } + }); + + }, + Test: function() { console.log("Test Start...."); diff --git a/procentric/application/lib/hoteltv.js b/procentric/application/lib/hoteltv.js index cbf9068..3711383 100755 --- a/procentric/application/lib/hoteltv.js +++ b/procentric/application/lib/hoteltv.js @@ -602,27 +602,18 @@ HotelTV.LoadAppFull = async function() { let recvMsg = e.data; //console.log(`Recv Msg[${recvMsg.event}]::> ${recvMsg.ret} ::> ${recvMsg.data}`); //console.log(`Recv Msg[${recvMsg.event}]::> ${recvMsg.ret}`); + if (recvMsg.event == "update_epg") { + if (recvMsg.ret === "OK") { + HotelTV.epg = recvMsg.data; + HotelTV.ui_appfull.UpdateEpg(); + } + } else if (recvMsg.event == "update_flight") { + if (recvMsg.ret === "OK") { + HotelTV.flight = { "count": recvMsg.data.count, "info": recvMsg.data.items }; + } + } else if (recvMsg.event == "update_weather") { - // if (recvMsg.event == "update_epg") { - // if (recvMsg.ret === "OK") { - // HotelTV.epg = recvMsg.data; - // HotelTV.ui_appfull.UpdateEpg(); - // } - // } else if (recvMsg.event == "update_news") { - // if (recvMsg.ret === "OK") { - // HotelTV.news = recvMsg.data; - // } - // } else if (recvMsg.event == "update_flight") { - // if (recvMsg.ret === "OK") { - // let x2js = new X2JS(); - // _rspJson = x2js.xml2json($.parseXML(recvMsg.data)); - // HotelTV.flight = { "count": Number(_rspJson.response.body.totalCount), "info": _rspJson.response.body.items.item }; - // } - // } else if (recvMsg.event == "update_weather") { - - // } - - if (recvMsg.event == "update_report") { + } else if (recvMsg.event == "update_report") { HotelTV.hcap.GetUptime(); HotelTV.hcap.GetDeviceUsage().then(_usage => { //console.log(`USAGE::> CPU[${_usage.cpu}%]`); diff --git a/procentric/application/lib/hoteltv.ui_welcome.js b/procentric/application/lib/hoteltv.ui_welcome.js index 78ccf41..7b4144a 100755 --- a/procentric/application/lib/hoteltv.ui_welcome.js +++ b/procentric/application/lib/hoteltv.ui_welcome.js @@ -6,7 +6,7 @@ * @summary short description for the file * @author Joel * - * Created at : 2020-11-26 02:21:56 + * Created at : 2020-11-26 02:21:56 * Last modified : 2020-11-26 15:31:40 */ @@ -32,7 +32,7 @@ HotelTV.ui_welcome = (function() { _media_status = 'playing'; HotelTV.hcap.VideoWinSize(null); - //Hide welcome page + //Hide welcome page __uifxn_WC_Show(null, function() { _state.menu.stage = "playWelcomeMovie"; @@ -212,7 +212,7 @@ HotelTV.ui_welcome = (function() { let _langCnt = Object.keys(_ctzOpening.languages).length; let _SupportedLang = _ctzOpening.languages; - //Add html elements for language selection + //Add html elements for language selection let _div_langsel = document.querySelector('.welcome #lst_langsel'); for (let __lang in _SupportedLang) { let _div_lang_btn = document.createElement('div'); @@ -257,7 +257,7 @@ HotelTV.ui_welcome = (function() { */ function __uifxn_WC_Show(uri_img, _callback) { if (uri_img != null) { - //Decision fist displyed language + //Decision fist displyed language let _state = HotelTV.state; let _ctzOpening = HotelTV.opening; let _ctzWc = _ctzOpening.welcome; @@ -292,8 +292,26 @@ HotelTV.ui_welcome = (function() { } else if (_evt.keyCode == 39) { $('#lst_langsel').trigger('next.owl') } else if (_evt.keyCode == 13) { + let found_dev_locale = false; // SET PLATFORM LANGUAGE // HotelTV.hcap.SetPlatformLanguage(_state.lang); + if ( 'getLocaleList' in HotelTV.devinfo ) + { + for( let _localeIdx in HotelTV.devinfo.getLocaleList ) + { + if ( HotelTV.devinfo.getLocaleList[_localeIdx].specifier== _state.lang ){ + found_dev_locale = true; + break; + } + } + } + if ( found_dev_locale==true ){ + HotelTV.hcap.SetDeviceLocale(_state.lang); + }else{ + console.log("Set Default device locale set to en-US"); + HotelTV.hcap.SetDeviceLocale('en-US'); + } + // LANGUAGE 선택 if (_ctzWc.intro == 'image') { @@ -357,7 +375,7 @@ HotelTV.ui_welcome = (function() { hndl_langSel.on('changed.owl.carousel', function(event) { - // Update Language + // Update Language console.log("LANG SEL[CHANGED]::>" + event.page.index); _state.lang = Object.keys(_ctzOpening.languages)[event.page.index]; __uifxn_WC_SetCtz(_ctzGst.name, _ctzWc.message); @@ -365,9 +383,9 @@ HotelTV.ui_welcome = (function() { } else { //Hide welcome main frame if (_callback != null) { - $(".welcome").fadeOut(1000, _callback); // display 속성을 none 으로 바꾼다. + $(".welcome").fadeOut(1000, _callback); // display 속성을 none 으로 바꾼다. } else { - $(".welcome").fadeOut(1000); // display 속성을 none 으로 바꾼다. + $(".welcome").fadeOut(1000); // display 속성을 none 으로 바꾼다. } } } @@ -380,7 +398,7 @@ HotelTV.ui_welcome = (function() { //ADD Network related event handler document.addEventListener("network_event_received", __uifxn_WC_OnNetEvt, false); - // Build up Welcome Page + // Build up Welcome Page __uifxn_WC_BldPage(); },