Базовая версия голосовых сообщений и аудиоплеер. Кодирование OPUS
This commit is contained in:
10
app/providers/PlayerProvider/usePlayerContext.ts
Normal file
10
app/providers/PlayerProvider/usePlayerContext.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { useContext } from "react";
|
||||
import { PlayerContext, PlayerContextValue } from "./PlayerProvider";
|
||||
|
||||
export function usePlayerContext() : PlayerContextValue {
|
||||
const context = useContext(PlayerContext);
|
||||
if (!context) {
|
||||
throw new Error("useAudioPlayer must be used within a PlayerProvider");
|
||||
}
|
||||
return context;
|
||||
}
|
||||
Reference in New Issue
Block a user