Provides access to the Readium AudioNavigator instance and all playback/navigation methods. See the Core Hooks API for the full interface reference.
Important
Import from @edrlab/thorium-web/audio when used alongside Stateful Components, not from @edrlab/thorium-web/core/hooks. All components must share the same navigator instance.
import { useAudioNavigator } from "@edrlab/thorium-web/audio";
const MyControls = () => {
const { play, pause, isPlaying, seek } = useAudioNavigator();
return (
<button onClick={ () => isPlaying() ? pause() : play() }>
{ isPlaying() ? "Pause" : "Play" }
</button>
);
};