From b164685ffefbdc8d680f177727ce9d9b02460487 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 21 Aug 2019 20:07:00 +0200 Subject: [PATCH] Some minor fixed to make the app buildadle on windows --- asm/download_compiled_files.sh | 33 +++++++++++++++++++ shared/html/index.php | 5 +++ shared/js/ConnectionHandler.ts | 3 +- .../permission/CanvasPermissionEditor.ts | 2 ++ .../modal/permission/HTMLPermissionEditor.ts | 2 ++ shared/js/voice/RecorderProfile.ts | 5 +++ todo.txt | 4 ++- tools/dtsgen/out.d.ts | 15 ++++++--- vendor/xbbcode | 2 +- web/js/voice/JavascriptRecorder.ts | 6 ++-- 10 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 asm/download_compiled_files.sh diff --git a/asm/download_compiled_files.sh b/asm/download_compiled_files.sh new file mode 100644 index 00000000..381217b4 --- /dev/null +++ b/asm/download_compiled_files.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +if [[ -d generated/ ]]; then + rm -r generated + [[ $? -ne 0 ]] && { + echo "Failed to remove old directory!" + exit 1 + } +fi +mkdir generated +[[ $? -ne 0 ]] && { + echo "Failed to create the 'generated' directory!" + exit 1 +} + +$(curl --version &> /dev/null) +[[ $? -ne 0 ]] && { + echo "Missing CURL. Please install it" + exit 1 +} + +curl https://web.teaspeak.de/wasm/TeaWeb-Worker-Codec-Opus.js --output generated/TeaWeb-Worker-Codec-Opus.js +[[ $? -ne 0 ]] && { + echo "Failed to download opus worker library" + exit 1 +} +curl https://web.teaspeak.de/wasm/TeaWeb-Worker-Codec-Opus.wasm --output generated/TeaWeb-Worker-Codec-Opus.wasm +[[ $? -ne 0 ]] && { + echo "Failed to download opus worker library natives" + exit 1 +} + +echo "Files downloaded successfully" \ No newline at end of file diff --git a/shared/html/index.php b/shared/html/index.php index 3c03dc4b..6cd78a9e 100644 --- a/shared/html/index.php +++ b/shared/html/index.php @@ -4,6 +4,9 @@ error_reporting(E_ALL); $WEB_CLIENT = http_response_code() !== false; + $localhost = false; + if(gethostname() == "WolverinDEV") + $localhost = true; ?> @@ -135,6 +138,7 @@ +
@@ -163,6 +167,7 @@ }); }, 2500); +
diff --git a/shared/js/ConnectionHandler.ts b/shared/js/ConnectionHandler.ts index 978b14c4..eccacee4 100644 --- a/shared/js/ConnectionHandler.ts +++ b/shared/js/ConnectionHandler.ts @@ -690,7 +690,8 @@ class ConnectionHandler { if(vconnection && vconnection.voice_recorder() && vconnection.voice_recorder().record_supported) { const active = !this.client_status.input_muted && !this.client_status.output_muted; - if(active) { + /* No need to start the microphone when we're not even connected */ + if(active && this.serverConnection.connected()) { if(vconnection.voice_recorder().input.current_state() === audio.recorder.InputState.PAUSED) { vconnection.voice_recorder().input.start().then(result => { if(result != audio.recorder.InputStartResult.EOK) { diff --git a/shared/js/ui/modal/permission/CanvasPermissionEditor.ts b/shared/js/ui/modal/permission/CanvasPermissionEditor.ts index 07aa7d54..a9d25cb7 100644 --- a/shared/js/ui/modal/permission/CanvasPermissionEditor.ts +++ b/shared/js/ui/modal/permission/CanvasPermissionEditor.ts @@ -1,3 +1,5 @@ +/// /* first needs the AbstractPermissionEdit */ + /* Canvas Permission Editor */ namespace pe { namespace ui { diff --git a/shared/js/ui/modal/permission/HTMLPermissionEditor.ts b/shared/js/ui/modal/permission/HTMLPermissionEditor.ts index 976efd73..172ea243 100644 --- a/shared/js/ui/modal/permission/HTMLPermissionEditor.ts +++ b/shared/js/ui/modal/permission/HTMLPermissionEditor.ts @@ -1,3 +1,5 @@ +/// /* first needs the AbstractPermissionEdit */ + namespace pe { class HTMLPermission { readonly handle: HTMLPermissionEditor; diff --git a/shared/js/voice/RecorderProfile.ts b/shared/js/voice/RecorderProfile.ts index 44ffc806..894e2ca0 100644 --- a/shared/js/voice/RecorderProfile.ts +++ b/shared/js/voice/RecorderProfile.ts @@ -82,11 +82,16 @@ class RecorderProfile { async initialize() : Promise { await this.load(); await this.reinitialize_filter(); + //Why we started directly after initialize? + //After we connect to a server the ConnectionHandler will automatically + //start the VoiceRecorder as soon we've a voice bridge. + /* try { await this.input.start(); } catch(error) { console.warn(tr("Failed to start recorder after initialize (%o)"), error); } + */ } private initialize_input() { diff --git a/todo.txt b/todo.txt index 772c4225..40b11561 100644 --- a/todo.txt +++ b/todo.txt @@ -71,4 +71,6 @@ - File Transfer bytes transferred, month & global (Up + Download) TODO: -Fix these icons: https://img.did.science/Screenshot_20-11-06.png \ No newline at end of file +Fix these icons: https://img.did.science/Screenshot_20-11-06.png +Fix auto TS compile for vendor emoji-picker +Make identity settings a bit smaller (Even scroll on my Laptop) \ No newline at end of file diff --git a/tools/dtsgen/out.d.ts b/tools/dtsgen/out.d.ts index c07e01ce..47527988 100644 --- a/tools/dtsgen/out.d.ts +++ b/tools/dtsgen/out.d.ts @@ -1,6 +1,13 @@ -/* File: C:\Users\WolverinDEV\TeaSpeak\TeaWeb\tools\dtsgen\test\test_05.ts */ -/// -/// -declare abstract class InfoManagerBase { +/* File: C:\Users\WolverinDEV\TeaSpeak\TeaWeb\tools\dtsgen\test\test_03.ts */ +declare enum YY { + H = "C", + B = "Y" +} +declare interface X { + type: any; + c: YY.B; +} +declare class X { + static x(); } diff --git a/vendor/xbbcode b/vendor/xbbcode index 11773c2d..d75eb02e 160000 --- a/vendor/xbbcode +++ b/vendor/xbbcode @@ -1 +1 @@ -Subproject commit 11773c2d5dc4a585b7a9136ac0a2bb87ebf94ebd +Subproject commit d75eb02ef8038595da5cc82d5953b170df9c49eb diff --git a/web/js/voice/JavascriptRecorder.ts b/web/js/voice/JavascriptRecorder.ts index 244367d3..f3762984 100644 --- a/web/js/voice/JavascriptRecorder.ts +++ b/web/js/voice/JavascriptRecorder.ts @@ -409,7 +409,7 @@ namespace audio { audio_constrains.echoCancellation = true; /* may supported */ (audio_constrains as any).autoGainControl = true; /* may supported */ (audio_constrains as any).noiseSuppression = true; - audio_constrains.sampleSize = {min: 420, max: 960 * 10, ideal: 960}; + /* disabled because most the time we get a OverconstrainedError */ //audio_constrains.sampleSize = {min: 420, max: 960 * 10, ideal: 960}; const stream = await media_function({audio: audio_constrains, video: undefined}); if(!_queried_permissioned) query_devices(); /* we now got permissions, requery devices */ @@ -441,8 +441,10 @@ namespace audio { if(!this._current_device) throw tr("invalid device"); - if(!this._audio_context) + if(!this._audio_context) { + debugger; throw tr("missing audio context"); + } const _result = await JavascriptInput.request_media_stream(this._current_device.device_id, this._current_device.group_id); if(!(_result instanceof MediaStream)) {