fix: start position and errors

This commit is contained in:
Fredrik Burmester
2024-10-16 18:58:45 +02:00
parent 6a4fe83fbb
commit ac4ce2934c
5 changed files with 71 additions and 19 deletions

View File

@@ -1,15 +1,7 @@
export type PlaybackStatePayload = {
nativeEvent: {
target: number;
state:
| "Opening"
| "Buffering"
| "Playing"
| "Paused"
| "Stopped"
| "Ended"
| "Error"
| "Unknown";
state: "Opening" | "Buffering" | "Playing" | "Paused" | "Error";
currentTime: number;
duration: number;
isBuffering: boolean;
@@ -69,6 +61,7 @@ export type VlcPlayerViewProps = {
onVideoStateChange?: (event: PlaybackStatePayload) => void;
onVideoLoadStart?: (event: VideoLoadStartPayload) => void;
onVideoLoadEnd?: (event: VideoLoadStartPayload) => void;
onVideoError?: (event: PlaybackStatePayload) => void;
};
export interface VlcPlayerViewRef {

View File

@@ -95,6 +95,7 @@ const VlcPlayerView = React.forwardRef<VlcPlayerViewRef, VlcPlayerViewProps>(
onVideoStateChange,
onVideoProgress,
onVideoLoadEnd,
onVideoError,
...otherProps
} = props;
@@ -120,6 +121,7 @@ const VlcPlayerView = React.forwardRef<VlcPlayerViewRef, VlcPlayerViewProps>(
onVideoLoadEnd={onVideoLoadEnd}
onVideoStateChange={onVideoStateChange}
onVideoProgress={onVideoProgress}
onVideoError={onVideoError}
/>
);
}