mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 00:01:34 +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",
|
||||
);
|
||||
|
||||
const [mgbaId, setMgbaId] = useState(0);
|
||||
|
||||
const setVolume = (newVolume: number) =>
|
||||
setState({ volume: newVolume, bindings });
|
||||
const setBindings = (newBindings: Bindings) =>
|
||||
|
@ -79,7 +81,7 @@ function App() {
|
|||
}
|
||||
|
||||
if (reset) {
|
||||
mgbaRef.current?.restart();
|
||||
setMgbaId((id) => id + 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -111,6 +113,7 @@ function App() {
|
|||
)}
|
||||
{isPlaying ? (
|
||||
<Mgba
|
||||
key={mgbaId}
|
||||
ref={mgbaRef}
|
||||
gameUrl={gameUrl}
|
||||
volume={volume}
|
||||
|
|
Loading…
Reference in a new issue