diff --git a/examples/basic/src/MultiValueControl.tsx b/examples/basic/src/components/MultiValueControl.tsx similarity index 95% rename from examples/basic/src/MultiValueControl.tsx rename to examples/basic/src/components/MultiValueControl.tsx index d9298ec3..99195b8d 100644 --- a/examples/basic/src/MultiValueControl.tsx +++ b/examples/basic/src/components/MultiValueControl.tsx @@ -21,7 +21,7 @@ interface MultiValueControlType { onPress: (arg: T) => void; } -const MultiValueControl = ({ +export const MultiValueControl = ({ values, selected, onPress, diff --git a/examples/basic/src/components/Overlay.tsx b/examples/basic/src/components/Overlay.tsx index 8d64baf7..ba964b2f 100644 --- a/examples/basic/src/components/Overlay.tsx +++ b/examples/basic/src/components/Overlay.tsx @@ -7,9 +7,7 @@ import React, { } from 'react'; import {View} from 'react-native'; import styles from '../styles.tsx'; -import ToggleControl from '../ToggleControl.tsx'; import {isAndroid, isIos, textTracksSelectionBy} from '../constants'; -import MultiValueControl from '../MultiValueControl.tsx'; import { ResizeMode, VideoRef, @@ -23,14 +21,15 @@ import { type VideoTrack, type AudioTrack, } from 'react-native-video'; -import { - toast, - Seeker, - AudioTrackSelector, - TextTrackSelector, - VideoTrackSelector, - TopControl, -} from '../components'; + +import {toast} from './Toast'; +import {Seeker} from './Seeker'; +import {AudioTrackSelector} from './AudioTracksSelector'; +import {VideoTrackSelector} from './VideoTracksSelector'; +import {TextTrackSelector} from './TextTracksSelector'; +import {TopControl} from './TopControl'; +import {ToggleControl} from './ToggleControl'; +import {MultiValueControl} from './MultiValueControl'; type Props = { channelDown: () => void; diff --git a/examples/basic/src/ToggleControl.tsx b/examples/basic/src/components/ToggleControl.tsx similarity index 97% rename from examples/basic/src/ToggleControl.tsx rename to examples/basic/src/components/ToggleControl.tsx index fd5f83a5..3757f155 100644 --- a/examples/basic/src/ToggleControl.tsx +++ b/examples/basic/src/components/ToggleControl.tsx @@ -25,7 +25,7 @@ interface ToggleControlType { onPress: () => void; } -const ToggleControl = ({ +export const ToggleControl = ({ isSelected, selectedText, unselectedText, diff --git a/examples/basic/src/components/index.ts b/examples/basic/src/components/index.ts index 71c9d731..70b755d4 100644 --- a/examples/basic/src/components/index.ts +++ b/examples/basic/src/components/index.ts @@ -7,3 +7,5 @@ export * from './TextTracksSelector'; export * from './Overlay'; export * from './TopControl'; export * from './Toast'; +export * from './ToggleControl'; +export * from './MultiValueControl'; diff --git a/examples/basic/src/constants/general.ts b/examples/basic/src/constants/general.ts index 6331d8a8..665a23cd 100644 --- a/examples/basic/src/constants/general.ts +++ b/examples/basic/src/constants/general.ts @@ -94,9 +94,9 @@ export const srcAllPlatformList = [ }, ]; -export const srcIosList = []; +export const srcIosList: SampleVideoSource[] = []; -export const srcAndroidList = [ +export const srcAndroidList: SampleVideoSource[] = [ { description: 'Another live sample', uri: 'https://live.forstreet.cl/live/livestream.m3u8', @@ -149,9 +149,12 @@ export const srcAndroidList = [ }, ]; -export const srcList: SampleVideoSource[] = srcAllPlatformList.concat( - isAndroid ? srcAndroidList : srcIosList, -); +const platformSrc: SampleVideoSource[] = isAndroid + ? srcAndroidList + : srcIosList; + +export const srcList: SampleVideoSource[] = + platformSrc.concat(srcAllPlatformList); export const bufferConfig: BufferConfig = { minBufferMs: 15000, diff --git a/examples/basic/src/types/types.ts b/examples/basic/src/types/types.ts index 7df4ead8..c9735c02 100644 --- a/examples/basic/src/types/types.ts +++ b/examples/basic/src/types/types.ts @@ -1,11 +1,11 @@ import {Drm, ReactVideoSource, TextTracks} from 'react-native-video'; export type AdditionalSourceInfo = { - textTracks: TextTracks; - adTagUrl: string; - description: string; - drm: Drm; - noView: boolean; + textTracks?: TextTracks; + adTagUrl?: string; + description?: string; + drm?: Drm; + noView?: boolean; }; export type SampleVideoSource = ReactVideoSource | AdditionalSourceInfo;