Skip to content

Commit

Permalink
group offscreen code together
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 12, 2024
1 parent aca22c6 commit b09b8bb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,6 @@ class XpraClient {
this._do_connect(false);
return;
}
if (this.offscreen_api) {
// check that it is actually available:
this.offscreen_api = DECODE_WORKER && XpraOffscreenWorker.isAvailable(this.ssl);
if (this.offscreen_api) {
this.set_encoding_option('video_max_size',[4096, 4096]);
}
}
this.clog("we have webworker support");
// spawn worker that checks for a websocket
const worker = new Worker("js/lib/wsworker_check.js");
Expand Down Expand Up @@ -567,10 +560,16 @@ class XpraClient {
if (!DECODE_WORKER) {
this.supported_encodings = safe_encodings;
this.decode_worker = false;
this.offscreen_api = false;
return;
}
let decode_worker;
if (this.offscreen_api) {
// check that it is actually available:
this.offscreen_api = DECODE_WORKER && XpraOffscreenWorker.isAvailable(this.ssl);
}
if (this.offscreen_api) {
this.set_encoding_option('video_max_size',[4096, 4096]);
this.clog("using offscreen decode worker");
decode_worker = new Worker("js/OffscreenDecodeWorker.js");
} else {
Expand Down

0 comments on commit b09b8bb

Please sign in to comment.