mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
force full reset which can get audio working on mobile
This commit is contained in:
parent
f053915c65
commit
61a7e2fa64
|
@ -51,6 +51,8 @@ function App() {
|
||||||
"agbrswebplayer",
|
"agbrswebplayer",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [mgbaId, setMgbaId] = useState(0);
|
||||||
|
|
||||||
const setVolume = (newVolume: number) =>
|
const setVolume = (newVolume: number) =>
|
||||||
setState({ volume: newVolume, bindings });
|
setState({ volume: newVolume, bindings });
|
||||||
const setBindings = (newBindings: Bindings) =>
|
const setBindings = (newBindings: Bindings) =>
|
||||||
|
@ -79,7 +81,7 @@ function App() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reset) {
|
if (reset) {
|
||||||
mgbaRef.current?.restart();
|
setMgbaId((id) => id + 1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -111,6 +113,7 @@ function App() {
|
||||||
)}
|
)}
|
||||||
{isPlaying ? (
|
{isPlaying ? (
|
||||||
<Mgba
|
<Mgba
|
||||||
|
key={mgbaId}
|
||||||
ref={mgbaRef}
|
ref={mgbaRef}
|
||||||
gameUrl={gameUrl}
|
gameUrl={gameUrl}
|
||||||
volume={volume}
|
volume={volume}
|
||||||
|
|
Loading…
Reference in a new issue