import React, {forwardRef} from 'react';
import Video, {
  type VideoRef as NativeVideoRef,
  type ReactVideoProps,
} from 'react-native-video';

export interface VideoRef extends NativeVideoRef {
  reload: () => void;
}

const RNVideo = forwardRef<VideoRef, ReactVideoProps>((props, ref) => (
  <Video ref={ref} disableAudioSessionManagement {...props} />
));

RNVideo.displayName = 'RNVideo';

export default RNVideo;
export {RNVideo};
export type {ReactVideoProps as VideoProps};
export {
  IgnoreSilentSwitchType,
  OnLoadData,
  OnPlaybackRateChangeData,
  OnProgressData,
  ResizeMode,
  SelectedTrackType,
  TextTrackType,
  type ISO639_1,
} from 'react-native-video';
