From 83f32d337bb4604d878c532167072ab10a078b07 Mon Sep 17 00:00:00 2001 From: Geraint Date: Sat, 19 Apr 2025 10:02:37 +0100 Subject: [PATCH] Web demo: don't show scope on mobile browsers --- web/demo/index.html | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/web/demo/index.html b/web/demo/index.html index 233cdf3..bbd6f14 100644 --- a/web/demo/index.html +++ b/web/demo/index.html @@ -156,12 +156,15 @@ }; let configValues = Object.assign({}, configValuesInitial); - // add scope, for fun - let scope = await Scope(audioContext); - scope.connect(audioContext.destination); - let scopeFrame = scope.openInterface(); - scopeFrame.id = 'scope'; - document.body.appendChild(scopeFrame); + let scope; + if (!/Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile/.test(navigator.userAgent)) { + // add scope for fun, but only on desktop + scope = await Scope(audioContext); + scope.connect(audioContext.destination); + let scopeFrame = scope.openInterface(); + scopeFrame.id = 'scope'; + document.body.appendChild(scopeFrame); + } // Drop zone document.body.ondragover = event => { @@ -195,7 +198,7 @@ stretch.disconnect(); } stretch = await SignalsmithStretch(audioContext); - stretch.connect(scope); + stretch.connect(scope || audioContext.destination); await stretch.addBuffers(channelBuffers); controlValues.loopEnd = audioDuration; configChanged();