[PlayerPanel] liveSubtitle lunaAPI

This commit is contained in:
고동영
2024-06-14 14:32:34 +09:00
parent 3a57d6322c
commit 78ceac0bc8
3 changed files with 102 additions and 7 deletions

View File

@@ -140,3 +140,60 @@ export function checkValidCountry(ricCode, country) {
}
}
}
// 3.0 ~ 4.5
export const setSubtitleEnable = (
showId,
captionEnable,
{ onSuccess, onFailure, onComplete }
) => {
if (
typeof window === "object" &&
window.PalmSystem &&
process.env.REACT_APP_MODE !== "DEBUG"
) {
if (captionEnable) {
return new LS2Request().send({
service: "luna://com.webos.service.tv.subtitle",
method: "enableSubtitle",
parameters: { pipelineId: showId },
onSuccess,
onFailure,
onComplete,
});
} else {
return new LS2Request().send({
service: "luna://com.webos.service.tv.subtitle",
method: "disableSubtitle",
parameters: { pipelineId: showId },
onSuccess,
onFailure,
onComplete,
});
}
}
};
// 5.0
export const setSubtitleEnableOver5 = (
showId,
{ onSuccess, onFailure, onComplete }
) => {
console.log("#sutitle action");
if (
typeof window === "object" &&
window.PalmSystem &&
process.env.REACT_APP_MODE !== "DEBUG"
) {
console.log("###showId", showId);
console.log("#onSuccess", onSuccess);
return new LS2Request().send({
service: "luna://com.webos.media",
method: "setSubtitleEnable",
parameters: { pipelineId: showId },
onSuccess,
onFailure,
onComplete,
});
}
};