UNPKG

3.08 kBSource Map (JSON)View Raw
1{"version":3,"file":"Video.types.js","sourceRoot":"","sources":["../src/Video.types.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IACf,iCAAmB,CAAA;AACrB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB","sourcesContent":["import * as React from 'react';\nimport { ImageProps, View } from 'react-native';\n\nimport {\n AVPlaybackNativeSource,\n AVPlaybackSource,\n AVPlaybackStatus,\n AVPlaybackStatusToSet,\n} from './AV';\n\nexport type VideoNaturalSize = {\n width: number;\n height: number;\n orientation: 'portrait' | 'landscape';\n};\n\nexport enum ResizeMode {\n CONTAIN = 'contain',\n COVER = 'cover',\n STRETCH = 'stretch',\n}\n\nexport type VideoReadyForDisplayEvent = {\n naturalSize: VideoNaturalSize;\n status: AVPlaybackStatus;\n};\n\nexport type VideoFullscreenUpdateEvent = {\n fullscreenUpdate: 0 | 1 | 2 | 3;\n status: AVPlaybackStatus;\n};\n\nexport type VideoProps = {\n // Source stuff\n source?: AVPlaybackSource; // { uri: 'http://foo/bar.mp4' }, Asset, or require('./foo/bar.mp4')\n posterSource?: ImageProps['source']; // { uri: 'http://foo/bar.mp4' } or require('./foo/bar.mp4')\n posterStyle?: ImageProps['style'];\n\n // Callbacks\n onPlaybackStatusUpdate?: (status: AVPlaybackStatus) => void;\n onLoadStart?: () => void;\n onLoad?: (status: AVPlaybackStatus) => void;\n onError?: (error: string) => void;\n onReadyForDisplay?: (event: VideoReadyForDisplayEvent) => void;\n onFullscreenUpdate?: (event: VideoFullscreenUpdateEvent) => void;\n onIOSFullscreenUpdate?: (event: VideoFullscreenUpdateEvent) => void;\n\n // UI stuff\n useNativeControls?: boolean;\n // NOTE(ide): This should just be ResizeMode. We have the explicit strings for now since we don't\n // currently the ResizeMode enum.\n resizeMode?: ResizeMode | 'stretch' | 'cover' | 'contain';\n usePoster?: boolean;\n\n // Playback API\n status?: AVPlaybackStatusToSet;\n progressUpdateIntervalMillis?: number;\n positionMillis?: number;\n shouldPlay?: boolean;\n rate?: number;\n shouldCorrectPitch?: boolean;\n volume?: number;\n isMuted?: boolean;\n isLooping?: boolean;\n\n // Required by react-native\n scaleX?: number;\n scaleY?: number;\n translateX?: number;\n translateY?: number;\n rotation?: number;\n} & React.ComponentProps<typeof View>;\n\nexport type VideoNativeProps = {\n source?: AVPlaybackNativeSource | null;\n resizeMode?: unknown;\n status?: AVPlaybackStatusToSet;\n onLoadStart?: () => void;\n onLoad?: (event: { nativeEvent: AVPlaybackStatus }) => void;\n onError?: (event: { nativeEvent: { error: string } }) => void;\n onStatusUpdate?: (event: { nativeEvent: AVPlaybackStatus }) => void;\n onReadyForDisplay?: (event: { nativeEvent: VideoReadyForDisplayEvent }) => void;\n onFullscreenUpdate?: (event: { nativeEvent: VideoFullscreenUpdateEvent }) => void;\n useNativeControls?: boolean;\n} & React.ComponentProps<typeof View>;\n\nexport type VideoState = {\n showPoster: boolean;\n};\nexport type ExponentVideoComponent = React.ComponentClass<VideoNativeProps>;\n"]}
\No newline at end of file