@@ -27,7 +27,7 @@ type ApiVideoLiveStreamProps = {
27
27
isStereo ?: boolean ;
28
28
} ;
29
29
zoomRatio ?: number ;
30
- enablePinchedZoom : boolean ;
30
+ enablePinchedZoom ? : boolean ;
31
31
32
32
onConnectionSuccess ?: ( ) => void ;
33
33
onConnectionFailed ?: ( code : string ) => void ;
@@ -77,23 +77,24 @@ const getDefaultBitrate = (resolution: Resolution): number => {
77
77
}
78
78
} ;
79
79
80
-
81
- function resolveResolution ( resolution : Resolution | PredefinedResolution ) : Resolution {
80
+ function resolveResolution (
81
+ resolution : Resolution | PredefinedResolution
82
+ ) : Resolution {
82
83
const predefinedResolutions : Record < PredefinedResolution , Resolution > = {
83
- " 1080p" : { width : 1920 , height : 1080 } ,
84
- " 720p" : { width : 1280 , height : 720 } ,
85
- " 480p" : { width : 854 , height : 480 } ,
86
- " 360p" : { width : 640 , height : 360 } ,
87
- " 240p" : { width : 352 , height : 240 } ,
84
+ ' 1080p' : { width : 1920 , height : 1080 } ,
85
+ ' 720p' : { width : 1280 , height : 720 } ,
86
+ ' 480p' : { width : 854 , height : 480 } ,
87
+ ' 360p' : { width : 640 , height : 360 } ,
88
+ ' 240p' : { width : 352 , height : 240 } ,
88
89
} ;
89
90
90
- if ( typeof resolution === " string" ) {
91
+ if ( typeof resolution === ' string' ) {
91
92
const predefined = predefinedResolutions [ resolution ] ;
92
93
if ( ! predefined ) {
93
- throw new Error ( " Unknown resolution" ) ;
94
+ throw new Error ( ' Unknown resolution' ) ;
94
95
}
95
96
return predefined ;
96
- }
97
+ }
97
98
return {
98
99
width : Math . max ( resolution . height , resolution . width ) ,
99
100
height : Math . min ( resolution . height , resolution . width ) ,
@@ -104,7 +105,7 @@ const ApiVideoLiveStreamView = forwardRef<
104
105
ApiVideoLiveStreamMethods ,
105
106
ApiVideoLiveStreamProps
106
107
> ( ( props , forwardedRef ) => {
107
- const resolution = resolveResolution ( props . video ?. resolution || " 720p" )
108
+ const resolution = resolveResolution ( props . video ?. resolution || ' 720p' ) ;
108
109
const nativeLiveStreamProps : NativeLiveStreamProps = {
109
110
...LIVE_STREAM_PROPS_DEFAULTS ,
110
111
...props ,
@@ -217,4 +218,7 @@ const ApiVideoLiveStreamView = forwardRef<
217
218
} ) ;
218
219
219
220
export { ApiVideoLiveStreamView } ;
220
- export type { Resolution , PredefinedResolution } from './NativeApiVideoLiveStreamView' ;
221
+ export type {
222
+ Resolution ,
223
+ PredefinedResolution ,
224
+ } from './NativeApiVideoLiveStreamView' ;
0 commit comments