Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions examples/realtime-console/src/pages/main/player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ const Player: React.FC<{
};
const videoState = localManager.get(LocalStorageKey.VIDEO_STATE);

const handleToggleVideoMirror = (e: CheckboxChangeEvent) => {
clientRef.current
?.getRtcEngine()
?.setLocalVideoMirrorType(e.target.checked ? 1 : 0);

localManager.set(
LocalStorageKey.VIDEO_MIRROR_STATE,
e.target.checked.toString(),
);
};
Comment thread
jackshen310 marked this conversation as resolved.

return (
<div className="player-container">
<div
Expand All @@ -35,6 +46,15 @@ const Player: React.FC<{
/>{' '}
Video
</label>
<label>
<Checkbox
defaultChecked={
localManager.get(LocalStorageKey.VIDEO_MIRROR_STATE) === 'true'
}
onChange={handleToggleVideoMirror}
/>{' '}
镜像
</label>
<a
href="https://bytedance.larkoffice.com/docx/BdIxdfjraoarXIx2Pszc7Yx5nre"
target="_blank"
Expand Down
1 change: 1 addition & 0 deletions examples/realtime-console/src/utils/local-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export enum LocalStorageKey {
ROOM_MODE = 'room_mode',
TRANSLATE_CONFIG = 'translate_config',
TURN_DETECTION_TYPE = 'turn_detection_type',
VIDEO_MIRROR_STATE = 'VIDEO_MIRROR_STATE',
}

export class LocalManager {
Expand Down