add colab setting

This commit is contained in:
wataru 2023-01-11 23:12:29 +09:00
parent 748a65217a
commit 6ecd5f0236
2 changed files with 25 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -87,6 +87,9 @@ export type ClientState = {
stop: () => Promise<void>;
getInfo: () => Promise<void>
}
export const useClient = (props: UseClientProps): ClientState => {
// (1) クライアント初期化
@ -103,6 +106,14 @@ export const useClient = (props: UseClientProps): ClientState => {
const [volume, setVolume] = useState<number>(0)
// Colab対応
useEffect(() => {
const params = new URLSearchParams(location.search);
const colab = params.get("colab")
if (colab == "true") {
}
}, [])
useEffect(() => {
const initialized = async () => {
@ -376,6 +387,19 @@ export const useClient = (props: UseClientProps): ClientState => {
}, [settingState, serverInfo])
// Colab対応
useEffect(() => {
const params = new URLSearchParams(location.search);
const colab = params.get("colab")
if (colab == "true") {
setSettingState({
...settingState,
protocol: "rest"
})
}
}, [])
return {
clientInitialized,
bufferingTime,