Skip to content

Commit 5790889

Browse files
committed
fix(*): fix yarn lint errors
1 parent aab8a85 commit 5790889

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

example/src/App.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import {
77
StatusBar,
88
Animated,
99
} from 'react-native';
10-
import { ApiVideoLiveStreamView, PredefinedResolution } from '@api.video/react-native-livestream';
10+
import {
11+
ApiVideoLiveStreamView,
12+
PredefinedResolution,
13+
} from '@api.video/react-native-livestream';
1114
import Icon from 'react-native-vector-icons/Ionicons';
1215
import styles, { button } from './style';
1316
import Settings from './components/settings';
@@ -35,7 +38,7 @@ export default function App() {
3538
message: string;
3639
}>({ display: false, message: '' });
3740
const [settings, setSettings] = React.useState<ISettingsState>({
38-
resolution: "360p",
41+
resolution: '360p',
3942
framerate: 30,
4043
videoBitrate: assets.sections.video.Bitrate.min,
4144
audioBitrate: 64000,

example/src/components/settings/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import assets from '../../assets';
1313
import type { ISettingsState } from 'example/src/App';
1414
import type { PredefinedResolution } from '@api.video/react-native-livestream';
1515

16-
1716
interface ISettingsProps {
1817
closeSettings: () => void;
1918
settings: ISettingsState;

src/NativeApiVideoLiveStreamView.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ export type Resolution = Readonly<{
1515
height: Int32;
1616
}>;
1717

18-
export type PredefinedResolution = "240p" | "360p" | "480p" | "720p" | "1080p";
19-
18+
export type PredefinedResolution = '240p' | '360p' | '480p' | '720p' | '1080p';
2019

2120
export type OnConnectionFailedEvent = Readonly<{
2221
code: string;

src/index.tsx

+17-13
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type ApiVideoLiveStreamProps = {
2727
isStereo?: boolean;
2828
};
2929
zoomRatio?: number;
30-
enablePinchedZoom: boolean;
30+
enablePinchedZoom?: boolean;
3131

3232
onConnectionSuccess?: () => void;
3333
onConnectionFailed?: (code: string) => void;
@@ -77,23 +77,24 @@ const getDefaultBitrate = (resolution: Resolution): number => {
7777
}
7878
};
7979

80-
81-
function resolveResolution(resolution: Resolution | PredefinedResolution): Resolution {
80+
function resolveResolution(
81+
resolution: Resolution | PredefinedResolution
82+
): Resolution {
8283
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 },
8889
};
8990

90-
if (typeof resolution === "string") {
91+
if (typeof resolution === 'string') {
9192
const predefined = predefinedResolutions[resolution];
9293
if (!predefined) {
93-
throw new Error("Unknown resolution");
94+
throw new Error('Unknown resolution');
9495
}
9596
return predefined;
96-
}
97+
}
9798
return {
9899
width: Math.max(resolution.height, resolution.width),
99100
height: Math.min(resolution.height, resolution.width),
@@ -104,7 +105,7 @@ const ApiVideoLiveStreamView = forwardRef<
104105
ApiVideoLiveStreamMethods,
105106
ApiVideoLiveStreamProps
106107
>((props, forwardedRef) => {
107-
const resolution = resolveResolution(props.video?.resolution || "720p")
108+
const resolution = resolveResolution(props.video?.resolution || '720p');
108109
const nativeLiveStreamProps: NativeLiveStreamProps = {
109110
...LIVE_STREAM_PROPS_DEFAULTS,
110111
...props,
@@ -217,4 +218,7 @@ const ApiVideoLiveStreamView = forwardRef<
217218
});
218219

219220
export { ApiVideoLiveStreamView };
220-
export type { Resolution, PredefinedResolution} from './NativeApiVideoLiveStreamView';
221+
export type {
222+
Resolution,
223+
PredefinedResolution,
224+
} from './NativeApiVideoLiveStreamView';

0 commit comments

Comments
 (0)