mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
add colab setting
This commit is contained in:
parent
748a65217a
commit
6ecd5f0236
2
client/demo/dist/index.js
vendored
2
client/demo/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user