chore(android): rework view type (#3940)

This commit is contained in:
Olivier Bouillet
2024-06-27 11:58:06 +02:00
committed by GitHub
parent 6e1337689a
commit b431d09e2f
10 changed files with 136 additions and 64 deletions

11
src/types/ViewType.ts Normal file
View File

@@ -0,0 +1,11 @@
/**
* Define Available view type for android
* these values shall match android spec, see ViewType.kt
*/
enum ResizeMode {
TEXTURE = 0,
SURFACE = 1,
SURFACE_SECURE = 2,
}
export default ResizeMode;

View File

@@ -5,5 +5,6 @@ export * from './language';
export {default as Orientation} from './Orientation';
export {default as ResizeMode} from './ResizeMode';
export {default as TextTrackType} from './TextTrackType';
export {default as ViewType} from './ViewType';
export * from './video';
export * from '../specs/VideoNativeComponent';

View File

@@ -3,6 +3,7 @@ import type {ReactVideoEvents} from './events';
import type {StyleProp, ViewProps, ViewStyle} from 'react-native';
import type VideoResizeMode from './ResizeMode';
import type FilterType from './FilterType';
import type ViewType from './ViewType';
export type Headers = Record<string, string>;
@@ -256,8 +257,9 @@ export interface ReactVideoProps extends ReactVideoEvents, ViewProps {
shutterColor?: string; // Android
textTracks?: TextTracks;
testID?: string;
useTextureView?: boolean; // Android
useSecureView?: boolean; // Android
viewType?: ViewType;
useTextureView?: boolean; // Android // deprecated
useSecureView?: boolean; // Android // deprecated
volume?: number;
localSourceEncryptionKeyScheme?: string;
debug?: DebugConfig;