diff --git a/src/Video.web.tsx b/src/Video.web.tsx index 8c150ae8..92146795 100644 --- a/src/Video.web.tsx +++ b/src/Video.web.tsx @@ -240,7 +240,13 @@ const Video = forwardRef( onVolumeChange?.({volume: nativeRef.current.volume}); }} 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 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 enabled = 'mediaSession' in navigator && showNotification; diff --git a/src/index.ts b/src/index.ts index 3dc7b7bd..0975a390 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ import Video from './Video'; export {VideoDecoderProperties} from './VideoDecoderProperties'; -export type * from './types'; +export * from './types'; export default Video;