mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Use onMediaUnsupported on android too
This commit is contained in:
parent
8c910fa532
commit
6265f9bc2c
@ -32,7 +32,7 @@ export type Snackbar = {
|
||||
key?: string;
|
||||
label: string;
|
||||
duration: number;
|
||||
actions: Action[];
|
||||
actions?: Action[];
|
||||
};
|
||||
|
||||
export type Action = {
|
||||
|
@ -64,7 +64,7 @@ const videoAtom = atom(0);
|
||||
const clientId = uuid.v4() as string;
|
||||
|
||||
const Video = forwardRef<VideoRef, VideoProps>(function Video(
|
||||
{ onLoad, onBuffer, source, subtitles, ...props },
|
||||
{ onLoad, onBuffer, onError, onMediaUnsupported, source, subtitles, ...props },
|
||||
ref,
|
||||
) {
|
||||
const { css } = useYoshiki();
|
||||
@ -98,6 +98,11 @@ const Video = forwardRef<VideoRef, VideoProps>(function Video(
|
||||
onLoad?.(info);
|
||||
}}
|
||||
onBuffer={onBuffer}
|
||||
onError={(e) => {
|
||||
// 24001 is codec error
|
||||
if (e.error.errorCode === "24001") onMediaUnsupported?.();
|
||||
else onError?.(e);
|
||||
}}
|
||||
selectedVideoTrack={
|
||||
video === -1
|
||||
? { type: SelectedVideoTrackType.AUDO }
|
||||
|
Loading…
x
Reference in New Issue
Block a user