issue #13 #12 #11 Support Coupang play, Wavve, TVING ott service.

This commit is contained in:
paul kim
2025-06-16 17:29:25 +09:00
parent c00aac016b
commit 39f3fa4b87
3 changed files with 148 additions and 34 deletions

View File

@@ -62,6 +62,7 @@ HotelTV.hal = (function() {
const g_nativApps_info = { const g_nativApps_info = {
'preapp': null, 'preapp': null,
'generalapp': null,
}; };
@@ -1520,30 +1521,104 @@ HotelTV.hal = (function() {
} }
}, },
PreAppGetInfo: function(_en_show_msg) { AppGetInfo: function(_en_show_msg) {
// if (g_nativApps_info.preapp == null) { return new Promise((resolve, reject) => {
// hcap.preloadedApplication.getPreloadedApplicationList({ hcap.application.getApplicationList({
// "onSuccess": function(s) { "onSuccess": function(s) {
// if (_en_show_msg == true) { if (_en_show_msg == true) {
// console.log("onSuccess : list length = " + s.list.length); console.log("onSuccess : list length = " + s.list.length);
// for (var i = 0; i < s.list.length; i++) { for (var i = 0; i < s.list.length; i++) {
// console.log( console.log(
// "list[" + i + "].id = " + s.list[i].id + "list[" + i + "].appId = " + s.list[i].appId +
// "list[" + i + "].title = " + s.list[i].title + "list[" + i + "].title = " + s.list[i].title +
// "list[" + i + "].iconFilePath = " + s.list[i].iconFilePath "list[" + i + "].version = " + s.list[i].version +
// ); "list[" + i + "].valid = " + s.list[i].valid +
// } "list[" + i + "].iconPath = " + s.list[i].iconPath
// } );
// if (s.result == true) { }
// g_nativApps_info.preapp = s.list; }
// } if (s.result == true) {
// }, g_nativApps_info.generalapp = s.list;
// "onFailure": function(f) { resolve({ "error": 0, "applist": g_nativApps_info.generalapp });
// console.log("onFailure : errorMessage = " + f.errorMessage); }
// } },
// }); "onFailure": function(f) {
// } console.log("onFailure : errorMessage = " + f.errorMessage);
resolve({ "error": -1, "applist": null });
}
});
});
},
AppInstall: function(list_app_id, _en_show_msg) {
return new Promise((resolve, reject) => {
hcap.application.installApplications({
"AppList" : list_app_id,
"onSuccess": function(s) {
if (_en_show_msg == true) {
console.log("onSuccess");
}
resolve({ "error": 0, "msg": "success" });
},
"onFailure": function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
resolve({ "error": -1, "msg": f.errorMessage });
}
});
});
},
LaunchApp: function(_name, _param) {
if (g_nativApps_info.generalapp != null) {
if (_name == "coupangplay") {
for (const [key, item] of Object.entries(g_nativApps_info.generalapp)) {
if (item.title == 'Coupang Play') {
hcap.application.launchApplication({
"id" : item.appId,
"onSuccess" : function() {
console.info("onSuccess");
},
"onFailure" : function(f) {
console.info("onFailure : errorMessage = " + f.errorMessage);
}
});
}
}
} else if (_name == "wavve") {
for (const [key, item] of Object.entries(g_nativApps_info.generalapp)) {
if (item.title == 'wavve') {
hcap.application.launchApplication({
"id" : item.appId,
"onSuccess" : function() {
console.info("onSuccess");
},
"onFailure" : function(f) {
console.info("onFailure : errorMessage = " + f.errorMessage);
}
});
}
}
} else if (_name == "tving") {
for (const [key, item] of Object.entries(g_nativApps_info.generalapp)) {
if (item.title == 'TVING') {
hcap.application.launchApplication({
"id" : item.appId,
"onSuccess" : function() {
console.info("onSuccess");
},
"onFailure" : function(f) {
console.info("onFailure : errorMessage = " + f.errorMessage);
}
});
}
}
}
} else {
console.log("General Application doesn't exist");
}
},
PreAppGetInfo: function(_en_show_msg) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
hcap.preloadedApplication.getPreloadedApplicationList({ hcap.preloadedApplication.getPreloadedApplicationList({
"onSuccess": function(s) { "onSuccess": function(s) {

View File

@@ -794,17 +794,50 @@ HotelTV.LoadAppFull = async function() {
//STEP#03: INIT HCAP for HotelTV FullAPP //STEP#03: INIT HCAP for HotelTV FullAPP
let tmrAppAuth = setInterval(async function() { let tmrAppAuth = setInterval(async function() {
let _list_install_appIDs = [];
let _NeedToDeleteTimer = false;
let _foundNetflix = false; let _foundNetflix = false;
let _hcapAppInfo = await HotelTV.hal.PreAppGetInfo(false); let _hcapPreloadAppInfo = await HotelTV.hal.PreAppGetInfo(false);
HotelTV.state['hcap_app'] = _hcapAppInfo.applist; let _hcapGeneralAppInfo = await HotelTV.hal.AppGetInfo(false);
for (_i = 0; _i < HotelTV.state['hcap_app'].length; _i++) { HotelTV.state['hcap_app_preload'] = _hcapPreloadAppInfo.applist;
if (HotelTV.state['hcap_app'][_i].title == "Netflix") { HotelTV.state['hcap_app_general'] = _hcapGeneralAppInfo.applist;
for (_i = 0; _i < HotelTV.state['hcap_app_preload'].length; _i++) {
if (HotelTV.state['hcap_app_preload'][_i].title == "Netflix") {
console.log("Found out netflix among of pre hcap app-list.") console.log("Found out netflix among of pre hcap app-list.")
clearInterval(tmrAppAuth); _foundNetflix = true;
_NeedToDeleteTimer = true;
} }
} }
if (_foundNetflix == false) { for (_i = 0; _i < HotelTV.state['hcap_app_general'].length; _i++) {
if (HotelTV.state['hcap_app_general'][_i].title == "TVING") {
if ( HotelTV.state['hcap_app_general'][_i].valid == false ){
console.warn("Found out TVING but not installed...");
_list_install_appIDs.push(HotelTV.state['hcap_app_general'][_i].appId);
}
} else if (HotelTV.state['hcap_app_general'][_i].title == "Coupang Play") {
if ( HotelTV.state['hcap_app_general'][_i].valid == false ){
console.warn("Found out Coupang Play but not installed...");
_list_install_appIDs.push(HotelTV.state['hcap_app_general'][_i].appId);
}
} else if (HotelTV.state['hcap_app_general'][_i].title == "wavve") {
if ( HotelTV.state['hcap_app_general'][_i].valid == false ){
console.warn("Found out wavve but not installed...");
_list_install_appIDs.push(HotelTV.state['hcap_app_general'][_i].appId);
}
}
}
if ( _list_install_appIDs.length>0 ){
await HotelTV.hal.AppInstall(_list_install_appIDs, false);
}
if ( _foundNetflix == true && _list_install_appIDs.length==0 ){
console.info("Preparing APP Done...");
clearInterval(tmrAppAuth);
}
if ( _foundNetflix == false ) {
try { try {
let siAppToken = null; let siAppToken = null;
let siAppName = null; let siAppName = null;

View File

@@ -502,8 +502,8 @@ HotelTV.ui_appfull = (function() {
_state.menu.stage.prev = _state.menu.stage.cur; _state.menu.stage.prev = _state.menu.stage.cur;
_state.menu.stage.cur = "external_av_hdmi"; _state.menu.stage.cur = "external_av_hdmi";
_state.external_input.connected = true; _state.external_input.connected = true;
// NOTE: US741H0ND모델에서 HDMI셋팅 인덱스는 0부터, 이 부분은 LG에 문의 필요 // NOTE: UR762H0NC모델에서 HDMI셋팅 인덱스는 0부터, 이 부분은 LG에 문의 필요
if (_devinfo.model_name.includes("US761H0ND")) { if (_devinfo.model_name.includes("US761H0ND") || _devinfo.model_name.includes("UM662H0NC")) {
_state.external_input.last_input.index = Number(_evt.index); _state.external_input.last_input.index = Number(_evt.index);
} else { } else {
_state.external_input.last_input.index = Number(_evt.index)-1; _state.external_input.last_input.index = Number(_evt.index)-1;
@@ -7080,8 +7080,8 @@ HotelTV.ui_appfull = (function() {
HotelTV.hal.LaunchPreApp(_program[Number(_state.menu.main.cur)].service, null); HotelTV.hal.LaunchPreApp(_program[Number(_state.menu.main.cur)].service, null);
} else if (_program[Number(_state.menu.main.cur)].service == "netflix") { } else if (_program[Number(_state.menu.main.cur)].service == "netflix") {
let _foundNetflix = false; let _foundNetflix = false;
for (_i = 0; _i < _state['hcap_app'].length; _i++) { for (_i = 0; _i < _state['hcap_app_preload'].length; _i++) {
if (_state['hcap_app'][_i].title == 'Netflix') { if (_state['hcap_app_preload'][_i].title == 'Netflix') {
_foundNetflix = true; _foundNetflix = true;
} }
} }
@@ -7093,7 +7093,13 @@ HotelTV.ui_appfull = (function() {
} }
} else if (_program[Number(_state.menu.main.cur)].service == "screenmirroring") { } else if (_program[Number(_state.menu.main.cur)].service == "screenmirroring") {
HotelTV.hal.LaunchPreApp(_program[Number(_state.menu.main.cur)].service, null); HotelTV.hal.LaunchPreApp(_program[Number(_state.menu.main.cur)].service, null);
} } else if (_program[Number(_state.menu.main.cur)].service == "coupangplay") {
HotelTV.hal.LaunchApp(_program[Number(_state.menu.main.cur)].service, null);
} else if (_program[Number(_state.menu.main.cur)].service == "wavve") {
HotelTV.hal.LaunchApp(_program[Number(_state.menu.main.cur)].service, null);
} else if (_program[Number(_state.menu.main.cur)].service == "tving") {
HotelTV.hal.LaunchApp(_program[Number(_state.menu.main.cur)].service, null);
}
} else if (_program[Number(_state.menu.main.cur)].type.toLowerCase() == "language") { } else if (_program[Number(_state.menu.main.cur)].type.toLowerCase() == "language") {
console.log("Preparing language select sub menu..."); console.log("Preparing language select sub menu...");
__uifxn_AppFull_Build_LangSel(); __uifxn_AppFull_Build_LangSel();