expose-on-seek-complete #1
@ -30,6 +30,7 @@ import type {
|
||||
OnPlaybackStateChangedData,
|
||||
OnProgressData,
|
||||
OnSeekData,
|
||||
OnSeekCompleteData,
|
||||
OnTextTrackDataChangedData,
|
||||
OnTimedMetadataData,
|
||||
OnVideoAspectRatioData,
|
||||
@ -90,6 +91,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
onError,
|
||||
onProgress,
|
||||
onSeek,
|
||||
onSeekComplete,
|
||||
onEnd,
|
||||
onBuffer,
|
||||
onBandwidthUpdate,
|
||||
@ -385,6 +387,13 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
[onSeek],
|
||||
);
|
||||
|
||||
const onVideoSeekComplete = useCallback(
|
||||
(e: NativeSyntheticEvent<OnSeekCompleteData>) => {
|
||||
onSeekComplete?.(e.nativeEvent);
|
||||
},
|
||||
[onSeekComplete]
|
||||
);
|
||||
|
||||
const onVideoPlaybackStateChanged = useCallback(
|
||||
(e: NativeSyntheticEvent<OnPlaybackStateChangedData>) => {
|
||||
onPlaybackStateChanged?.(e.nativeEvent);
|
||||
@ -716,6 +725,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
onVideoError={onError ? onVideoError : undefined}
|
||||
onVideoProgress={onProgress ? onVideoProgress : undefined}
|
||||
onVideoSeek={onSeek ? onVideoSeek : undefined}
|
||||
onVideoSeekComplete={onSeekComplete ? onVideoSeekComplete : undefined}
|
||||
onVideoEnd={onEnd}
|
||||
onVideoBuffer={onBuffer ? onVideoBuffer : undefined}
|
||||
onVideoPlaybackStateChanged={
|
||||
|
@ -182,6 +182,12 @@ export type OnSeekData = Readonly<{
|
||||
seekTime: Float;
|
||||
}>;
|
||||
|
||||
export type OnVideoSeekCompleteData = Readonly<{
|
||||
currentTime: number;
|
||||
seekTime: number;
|
||||
target: number;
|
||||
}>;
|
||||
|
||||
export type OnPlaybackStateChangedData = Readonly<{
|
||||
isPlaying: boolean;
|
||||
isSeeking: boolean;
|
||||
|
@ -258,6 +258,7 @@ export interface ReactVideoEvents {
|
||||
onReceiveAdEvent?: (e: OnReceiveAdEventData) => void; //Android, iOS
|
||||
onRestoreUserInterfaceForPictureInPictureStop?: () => void; //iOS
|
||||
onSeek?: (e: OnSeekData) => void; //Android, iOS, Windows UWP
|
||||
onSeekComplete?: (e: OnSeekCompleteData) -> void; // iOS
|
||||
onPlaybackStateChanged?: (e: OnPlaybackStateChangedData) => void; // Android, iOS
|
||||
onTimedMetadata?: (e: OnTimedMetadataData) => void; //Android, iOS
|
||||
onAudioTracks?: (e: OnAudioTracksData) => void; // Android
|
||||
|
Loading…
Reference in New Issue
Block a user