@@ -10,7 +10,12 @@ import { Keyboard } from '@/components/keyboard';
10
10
import { Menu } from '@/components/menu' ;
11
11
import { Mouse } from '@/components/mouse' ;
12
12
import { VirtualKeyboard } from '@/components/virtual-keyboard' ;
13
- import { resolutionAtom , serialStateAtom , videoStateAtom } from '@/jotai/device.ts' ;
13
+ import {
14
+ resolutionAtom ,
15
+ serialStateAtom ,
16
+ videoScaleAtom ,
17
+ videoStateAtom
18
+ } from '@/jotai/device.ts' ;
14
19
import { isKeyboardEnableAtom } from '@/jotai/keyboard.ts' ;
15
20
import { mouseStyleAtom } from '@/jotai/mouse.ts' ;
16
21
import { camera } from '@/libs/camera' ;
@@ -23,6 +28,7 @@ const App = () => {
23
28
const isBigScreen = useMediaQuery ( { minWidth : 850 } ) ;
24
29
25
30
const mouseStyle = useAtomValue ( mouseStyleAtom ) ;
31
+ const videoScale = useAtomValue ( videoScaleAtom ) ;
26
32
const videoState = useAtomValue ( videoStateAtom ) ;
27
33
const serialState = useAtomValue ( serialStateAtom ) ;
28
34
const isKeyboardEnable = useAtomValue ( isKeyboardEnableAtom ) ;
@@ -107,7 +113,13 @@ const App = () => {
107
113
< video
108
114
id = "video"
109
115
className = { clsx ( 'block min-h-[480px] min-w-[640px] select-none' , mouseStyle ) }
110
- style = { { maxWidth : '100%' , maxHeight : '100%' , objectFit : 'scale-down' } }
116
+ style = { {
117
+ transform : `scale(${ videoScale } )` ,
118
+ transformOrigin : 'center' ,
119
+ maxWidth : '100%' ,
120
+ maxHeight : '100%' ,
121
+ objectFit : 'scale-down'
122
+ } }
111
123
autoPlay
112
124
playsInline
113
125
/>
0 commit comments