React Native Video selectedVideoTrack prop not working in android phones
Asked Answered
L

1

0

selectedVideoTrack prop not working in android phone. Here is the Video componenet

        <Video
            source={{uri: uri}}
            ref={videoPlayer}
            poster={thumbnail}
            style={orientation === 'PORTRAIT' ? styles.video : styles.landscapeVideo}

            onLoadStart={onLoadStart}
            onLoad={onLoad}
            onProgress={onProgress}
            paused={paused}
            rate={playSpeed}

            selectedVideoTrack={{
                type: "resolution",
                value: 144
            }}

            repeat={true}
            controls={false}
            playInBackground={true}
            resizeMode={'stretch'}
            fullscreen={true}
            pictureInPicture={true}
            muted={false}
        />

m3u8 file

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=239800,RESOLUTION=256x144,CODECS="avc1.64000c,mp4a.40.2",FRAME-RATE=30.000
video_0_90.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=580800,RESOLUTION=854x480,CODECS="avc1.64001f,mp4a.40.2",FRAME-RATE=30.000
video_1_400.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=910800,RESOLUTION=1280x720,CODECS="avc1.64001f,mp4a.40.2",FRAME-RATE=30.000
video_2_700.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1240800,RESOLUTION=1920x1080,CODECS="avc1.640028,mp4a.40.2",FRAME-RATE=30.000
video_3_1000.m3u8
#EXT-X-ENDLIST

I am using "react-native-video": "^5.2.0"

Lance answered 14/2, 2022 at 15:3 Comment(0)
L
1

added these lines in react-native.config.js help me to achieve it in android

module.exports = {
    dependencies: {
        'react-native-video': {
            platforms: {
                android: {
                    sourceDir: '../node_modules/react-native-video/android-exoplayer',
                },
            },
        },
    },
    assets:['./src/assets/fonts/'],
};

remove assets:['./src/assets/fonts/'], if you don't have fonts directory.

Lance answered 16/2, 2022 at 20:39 Comment(2)
app crashes on adding above in the file on playing video. Why it is happening. Let me know if there is any known issue.Liam
Can't say anything without seeing logsLance

© 2022 - 2024 — McMap. All rights reserved.