Fix web bugs
This commit is contained in:
parent
aa85d71b87
commit
975fc2f303
@ -240,7 +240,13 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
|||||||
onVolumeChange?.({volume: nativeRef.current.volume});
|
onVolumeChange?.({volume: nativeRef.current.volume});
|
||||||
}}
|
}}
|
||||||
onEnded={onEnd}
|
onEnded={onEnd}
|
||||||
style={{position: 'absolute', inset: 0, objectFit: 'contain'}}
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
inset: 0,
|
||||||
|
objectFit: 'contain',
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -258,7 +264,9 @@ const useMediaSession = (
|
|||||||
) => {
|
) => {
|
||||||
const isPlaying = !nativeRef.current?.paused ?? false;
|
const isPlaying = !nativeRef.current?.paused ?? false;
|
||||||
const progress = nativeRef.current?.currentTime ?? 0;
|
const progress = nativeRef.current?.currentTime ?? 0;
|
||||||
const duration = nativeRef.current?.duration ?? 100;
|
const duration = Number.isFinite(nativeRef.current?.duration)
|
||||||
|
? nativeRef.current?.duration
|
||||||
|
: undefined;
|
||||||
const playbackRate = nativeRef.current?.playbackRate ?? 1;
|
const playbackRate = nativeRef.current?.playbackRate ?? 1;
|
||||||
|
|
||||||
const enabled = 'mediaSession' in navigator && showNotification;
|
const enabled = 'mediaSession' in navigator && showNotification;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import Video from './Video';
|
import Video from './Video';
|
||||||
export {VideoDecoderProperties} from './VideoDecoderProperties';
|
export {VideoDecoderProperties} from './VideoDecoderProperties';
|
||||||
export type * from './types';
|
export * from './types';
|
||||||
export default Video;
|
export default Video;
|
||||||
|
Loading…
Reference in New Issue
Block a user