Skip to content

Commit

Permalink
1分間無操作であればデータ取得中の表示を消すように
Browse files Browse the repository at this point in the history
  • Loading branch information
otya128 committed Oct 17, 2022
1 parent abca520 commit 76e33aa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions browser/src/TVTDataBroadcastingWV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ function onMessage(msg: ResponseMessage) {
if (!oneSegLaunched) {
browserElement.style.visibility = "hidden";
}
remoteControlStatusContainer.style.visibility = "visible";
}
postMessage({
type: "serviceInfo",
Expand Down Expand Up @@ -504,7 +505,15 @@ type ToWebViewMessage = {
type: "launchOneSeg",
};

// 1分間無操作であればデータ取得中の表示を消す
let remoteControlStatusTimeoutMillis = 60 * 1000;
let remoteControlStatusTimeout = Number.MAX_VALUE;

function onWebViewMessage(data: ToWebViewMessage, reply: (data: FromWebViewMessage) => void) {
if (!cProfile && data.type !== "key" && performance.now() >= remoteControlStatusTimeout) {
remoteControlStatusContainer.style.visibility = "hidden";
remoteControlStatusTimeout = Number.MAX_VALUE;
}
if (data.type === "stream") {
if (!oneSegLaunched && cProfile) {
return;
Expand All @@ -531,6 +540,7 @@ function onWebViewMessage(data: ToWebViewMessage, reply: (data: FromWebViewMessa
remoteControlStatusContainer.style.visibility = "visible";
bmlBrowser.content.processKeyDown(data.keyCode);
bmlBrowser.content.processKeyUp(data.keyCode);
remoteControlStatusTimeout = performance.now() + remoteControlStatusTimeoutMillis;
} else if (data.type === "caption") {
if (data.enable) {
if (data.showIndicator) {
Expand Down

0 comments on commit 76e33aa

Please sign in to comment.