mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-02 13:14:29 -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;
|
key?: string;
|
||||||
label: string;
|
label: string;
|
||||||
duration: number;
|
duration: number;
|
||||||
actions: Action[];
|
actions?: Action[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Action = {
|
export type Action = {
|
||||||
|
@ -64,7 +64,7 @@ const videoAtom = atom(0);
|
|||||||
const clientId = uuid.v4() as string;
|
const clientId = uuid.v4() as string;
|
||||||
|
|
||||||
const Video = forwardRef<VideoRef, VideoProps>(function Video(
|
const Video = forwardRef<VideoRef, VideoProps>(function Video(
|
||||||
{ onLoad, onBuffer, source, subtitles, ...props },
|
{ onLoad, onBuffer, onError, onMediaUnsupported, source, subtitles, ...props },
|
||||||
ref,
|
ref,
|
||||||
) {
|
) {
|
||||||
const { css } = useYoshiki();
|
const { css } = useYoshiki();
|
||||||
@ -98,6 +98,11 @@ const Video = forwardRef<VideoRef, VideoProps>(function Video(
|
|||||||
onLoad?.(info);
|
onLoad?.(info);
|
||||||
}}
|
}}
|
||||||
onBuffer={onBuffer}
|
onBuffer={onBuffer}
|
||||||
|
onError={(e) => {
|
||||||
|
// 24001 is codec error
|
||||||
|
if (e.error.errorCode === "24001") onMediaUnsupported?.();
|
||||||
|
else onError?.(e);
|
||||||
|
}}
|
||||||
selectedVideoTrack={
|
selectedVideoTrack={
|
||||||
video === -1
|
video === -1
|
||||||
? { type: SelectedVideoTrackType.AUDO }
|
? { type: SelectedVideoTrackType.AUDO }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user