mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 11:38:37 +00:00
hotfix: no sound in ios webkit
This commit is contained in:
parent
ad053361dc
commit
5334abebaa
@ -3,7 +3,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite --host",
|
||||||
"start": "vite",
|
"start": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import logo from './logo.svg';
|
|||||||
import * as tunes from './tunes.mjs';
|
import * as tunes from './tunes.mjs';
|
||||||
import * as WebDirt from 'WebDirt';
|
import * as WebDirt from 'WebDirt';
|
||||||
import { loadWebDirt } from '@strudel.cycles/webdirt';
|
import { loadWebDirt } from '@strudel.cycles/webdirt';
|
||||||
import { resetLoadedSamples } from '@strudel.cycles/webaudio';
|
import { resetLoadedSamples, getAudioContext } from '@strudel.cycles/webaudio';
|
||||||
|
|
||||||
evalScope(
|
evalScope(
|
||||||
Tone,
|
Tone,
|
||||||
@ -140,7 +140,13 @@ function App() {
|
|||||||
<h1 className={isEmbedded ? 'text-l' : 'text-xl'}>Strudel {isEmbedded ? 'Mini ' : ''}REPL</h1>
|
<h1 className={isEmbedded ? 'text-l' : 'text-xl'}>Strudel {isEmbedded ? 'Mini ' : ''}REPL</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<button onClick={() => togglePlay()} className={cx('hover:bg-gray-300', !isEmbedded ? 'p-2' : 'px-2')}>
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
getAudioContext().resume(); // fixes no sound in ios webkit
|
||||||
|
togglePlay();
|
||||||
|
}}
|
||||||
|
className={cx('hover:bg-gray-300', !isEmbedded ? 'p-2' : 'px-2')}
|
||||||
|
>
|
||||||
{!pending ? (
|
{!pending ? (
|
||||||
<span className={cx('flex items-center', isEmbedded ? 'w-16' : 'w-16')}>
|
<span className={cx('flex items-center', isEmbedded ? 'w-16' : 'w-16')}>
|
||||||
{cycle.started ? (
|
{cycle.started ? (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user