I have a video file in MKV format, i want to play that file on mobile app. This is my current code.
import * as React from 'react';
import { View, StyleSheet, Button, Dimensions } from 'react-native';
import { Video } from 'expo-av';
const VideoPlayerItem = (props) => {
const video = React.useRef(null);
const [status, setStatus] = React.useState({});
return (
<View style={styles.container}>
<Video
ref={video}
style={styles.video}
source={{
uri: props.videoSource,
}}
useNativeControls
resizeMode="contain"
shouldPlay={true}
isLooping
onPlaybackStatusUpdate={status => setStatus(() => status)}
/>
<View style={styles.buttons}>
<Button
title={status.isPlaying ? 'Pause' : 'Play'}
onPress={() =>
status.isPlaying ? video.current.pauseAsync() : video.current.playAsync()
}
/>
</View>
</View>
);
}
export default VideoPlayerItem
When I use .mp4 format file, I can play.
But, I can't play mkv format video.
who can help me about this issue?