diff --git a/docs/system-requirements.md b/docs/system-requirements.md index 49f425b8940..9907eeb6e8e 100644 --- a/docs/system-requirements.md +++ b/docs/system-requirements.md @@ -22,6 +22,18 @@ Apache and Nginx must use: Other combinations will not work due to the long polling used for chat and signaling messages, see [this issue](https://github.com/nextcloud/spreed/issues/2211#issuecomment-610198026) for details. +### WebAssembly and TensorFlow Lite files + +Since Talk 13 the web server needs to handle WebAssembly (.wasm) and TensorFlow Lite (.tflite) files in a similar way to JavaScript and CSS files, as they will be requested by Talk clients to provide certain features (for example, the background blur when Talk is running in a browser). If Apache is used the default configuration provided by the Nextcloud server should be enough; if NGINX is used please refer to the [_NGINX configuration_ section in Nextcloud Administration manual](https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html). + +Besides that the web server should associate _.wasm_ files with the right MIME type. This is not strictly needed, though, but if they are not the browser console may show a warning similar to: +``` +wasm streaming compile failed: TypeError: WebAssembly: Response has unsupported MIME type '' expected 'application/wasm' +falling back to ArrayBuffer instantiation +``` + +In Apache, if _mod_mime_ and _.htaccess_ files are enabled, the default _.htaccess_ file in Nextcloud server associates the _application/wasm_ MIME type with _.wasm_ files. Alternatively the association can be done by adding `AddType application/wasm .wasm` in _/etc/apache2/mods-enabled/mime.conf_, or `application/wasm wasm` to _/etc/mime.types_. Similarly, the default configuration for NGINX does the association too, but alternatively it can be done by adding `application/wasm wasm;` to _/etc/nginx/mime.types_. + ## TURN server A TURN server running on **port 443** (or 80) is required in almost all scenarios, see [Configuring coTURN](TURN.md) for more details. diff --git a/src/components/AdminSettings/WebServerSetupChecks.vue b/src/components/AdminSettings/WebServerSetupChecks.vue new file mode 100644 index 00000000000..95d4668b4a5 --- /dev/null +++ b/src/components/AdminSettings/WebServerSetupChecks.vue @@ -0,0 +1,178 @@ + + + + + + + diff --git a/src/utils/media/pipeline/VirtualBackground.js b/src/utils/media/pipeline/VirtualBackground.js index 77e384b92ea..de5258ade29 100644 --- a/src/utils/media/pipeline/VirtualBackground.js +++ b/src/utils/media/pipeline/VirtualBackground.js @@ -64,31 +64,49 @@ export default class VirtualBackground extends TrackSinkSource { static _canvasFilterSupported static isSupported() { - return this._isWasmSupported() && this._isCanvasFilterSupported() + return this.isWasmSupported() && this.isCanvasFilterSupported() } - static _isWasmSupported() { - if (this._wasmSupported === undefined) { - try { - const wasmCheck = require('wasm-check') - this._wasmSupported = true - - if (wasmCheck?.feature?.simd) { - this._wasmSimd = true - } else { - this._wasmSimd = false - } - } catch (error) { - this._wasmSupported = false - - console.error('Looks like WebAssembly is disabled or not supported on this browser, virtual background will not be available') + static _checkWasmSupport() { + try { + const wasmCheck = require('wasm-check') + this._wasmSupported = true + + if (wasmCheck?.feature?.simd) { + this._wasmSimd = true + } else { + this._wasmSimd = false } + } catch (error) { + this._wasmSupported = false + + console.error('Looks like WebAssembly is disabled or not supported on this browser, virtual background will not be available') + } + } + + static isWasmSupported() { + if (this._wasmSupported === undefined) { + this._checkWasmSupport() } return this._wasmSupported } - static _isCanvasFilterSupported() { + /** + * Returns whether SIMD instructions are available in WebAssembly or not. + * + * @return {boolean} undefined if WebAssembly is not supported, true if SIMD + * instructions are available in WebAssembly, or false otherwise. + */ + static isWasmSimd() { + if (this._wasmSupported === undefined) { + this._checkWasmSupport() + } + + return this._wasmSimd + } + + static isCanvasFilterSupported() { if (this._canvasFilterSupported === undefined) { const canvas = document.createElement('canvas') const context = canvas.getContext('2d') @@ -129,11 +147,11 @@ export default class VirtualBackground extends TrackSinkSource { }, } - if (!VirtualBackground._isWasmSupported()) { + if (!VirtualBackground.isWasmSupported()) { return } - const isSimd = VirtualBackground._wasmSimd + const isSimd = VirtualBackground.isWasmSimd() const virtualBackground = { type: VIRTUAL_BACKGROUND_TYPE.NONE, diff --git a/src/views/AdminSettings.vue b/src/views/AdminSettings.vue index 095c7903b92..e86397f63bb 100644 --- a/src/views/AdminSettings.vue +++ b/src/views/AdminSettings.vue @@ -26,6 +26,7 @@ + @@ -44,6 +45,7 @@ import SignalingServers from '../components/AdminSettings/SignalingServers' import SIPBridge from '../components/AdminSettings/SIPBridge' import StunServers from '../components/AdminSettings/StunServers' import TurnServers from '../components/AdminSettings/TurnServers' +import WebServerSetupChecks from '../components/AdminSettings/WebServerSetupChecks' export default { name: 'AdminSettings', @@ -58,6 +60,7 @@ export default { SIPBridge, StunServers, TurnServers, + WebServerSetupChecks, }, }