fix(ts): onPlaybackRateChangeData was not correctly typed (#3651)
This commit is contained in:
parent
10b100de44
commit
2a858df8bc
@ -36,6 +36,8 @@ import Video, {
|
||||
OnTextTrackDataChangedData,
|
||||
TextTrackType,
|
||||
ISO639_1,
|
||||
OnPlaybackStateChangedData,
|
||||
OnPlaybackRateChangeData,
|
||||
} from 'react-native-video';
|
||||
import ToggleControl from './ToggleControl';
|
||||
import MultiValueControl, {
|
||||
@ -335,6 +337,14 @@ class VideoPlayer extends Component {
|
||||
this.channelUp();
|
||||
};
|
||||
|
||||
onPlaybackRateChange = (data: OnPlaybackRateChangeData) => {
|
||||
console.log('onPlaybackRateChange', data);
|
||||
}
|
||||
|
||||
onPlaybackStateChanged = (data: OnPlaybackStateChangedData) => {
|
||||
console.log('onPlaybackStateChanged', data);
|
||||
}
|
||||
|
||||
toggleFullscreen() {
|
||||
this.setState({fullscreen: !this.state.fullscreen});
|
||||
}
|
||||
@ -805,6 +815,8 @@ class VideoPlayer extends Component {
|
||||
selectedAudioTrack={this.state.selectedAudioTrack}
|
||||
playInBackground={false}
|
||||
preventsDisplaySleepDuringVideoPlayback={true}
|
||||
onPlaybackRateChange={this.onPlaybackRateChange}
|
||||
onPlaybackStateChanged={this.onPlaybackStateChanged}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
@ -218,7 +218,7 @@ export type OnVideoTracksData = Readonly<{
|
||||
}[];
|
||||
}>;
|
||||
|
||||
export type OnPlaybackData = Readonly<{
|
||||
export type OnPlaybackRateChangeData = Readonly<{
|
||||
playbackRate: Float;
|
||||
}>;
|
||||
|
||||
@ -328,7 +328,7 @@ export interface VideoNativeProps extends ViewProps {
|
||||
onVideoFullscreenPlayerWillDismiss?: DirectEventHandler<{}>; // ios, android
|
||||
onVideoFullscreenPlayerDidDismiss?: DirectEventHandler<{}>; // ios, android
|
||||
onReadyForDisplay?: DirectEventHandler<{}>;
|
||||
onPlaybackRateChange?: DirectEventHandler<OnPlaybackData>; // all
|
||||
onPlaybackRateChange?: DirectEventHandler<OnPlaybackRateChangeData>; // all
|
||||
onVolumeChange?: DirectEventHandler<OnVolumeChangeData>; // android, ios
|
||||
onVideoExternalPlaybackChange?: DirectEventHandler<OnExternalPlaybackChangeData>;
|
||||
onGetLicense?: DirectEventHandler<OnGetLicenseData>;
|
||||
|
@ -7,7 +7,7 @@ import type {
|
||||
OnExternalPlaybackChangeData,
|
||||
OnLoadStartData,
|
||||
OnPictureInPictureStatusChangedData,
|
||||
OnPlaybackData,
|
||||
OnPlaybackRateChangeData,
|
||||
OnPlaybackStateChangedData,
|
||||
OnProgressData,
|
||||
OnSeekData,
|
||||
@ -239,7 +239,7 @@ export interface ReactVideoEvents {
|
||||
onPictureInPictureStatusChanged?: (
|
||||
e: OnPictureInPictureStatusChangedData,
|
||||
) => void; //iOS
|
||||
onPlaybackRateChange?: (e: OnPlaybackData) => void; //All
|
||||
onPlaybackRateChange?: (e: OnPlaybackRateChangeData) => void; //All
|
||||
onVolumeChange?: (e: OnVolumeChangeData) => void; //Android, iOS
|
||||
onProgress?: (e: OnProgressData) => void; //All
|
||||
onReadyForDisplay?: () => void; //Android, iOS
|
||||
|
Loading…
Reference in New Issue
Block a user