-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #462 from shiguredo/feature/add-media-access-button
Sora に接続を行わずに Audio / Video デバイスの表示再生を行う機能を追加
- Loading branch information
Showing
11 changed files
with
310 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
|
||
import { disposeMedia } from '@/app/actions'; | ||
import { useAppDispatch, useAppSelector } from '@/app/hooks'; | ||
import { isFormDisabled } from '@/utils'; | ||
|
||
export const DisposeMediaButton: React.FC = () => { | ||
const dispatch = useAppDispatch(); | ||
const onClick = (): void => { | ||
dispatch(disposeMedia()); | ||
}; | ||
const connectionStatus = useAppSelector((state) => state.soraContents.connectionStatus); | ||
const sora = useAppSelector((state) => state.soraContents.sora); | ||
const role = useAppSelector((state) => state.role); | ||
const disabled = role === 'recvonly' || sora !== null || isFormDisabled(connectionStatus); | ||
return ( | ||
<div className="col-auto mb-1"> | ||
<input | ||
className="btn btn-secondary" | ||
type="button" | ||
name="media_access" | ||
defaultValue="dispose media" | ||
onClick={onClick} | ||
disabled={disabled} | ||
/> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.