Closed DevineDecrypter closed 2 years ago
+1
I solved this by adding a react-native.config.js
file to root of my project with:
module.exports = { dependencies: { 'react-native-video': { platforms: { android: { sourceDir: '../node_modules/react-native-video/android-exoplayer', }, }, }, }, };
I solved this by adding a
react-native.config.js
file to root of my project with:module.exports = { dependencies: { 'react-native-video': { platforms: { android: { sourceDir: '../node_modules/react-native-video/android-exoplayer', }, }, }, }, };
may I ask how did you come up with this solution?
I solved this by adding a
react-native.config.js
file to root of my project with:module.exports = { dependencies: { 'react-native-video': { platforms: { android: { sourceDir: '../node_modules/react-native-video/android-exoplayer', }, }, }, }, };
may I ask how did you come up with this solution?
I believe that Exo Player doesn't come packed with react-native-video on Android by default, so you need to add this config file to tell React Native to pack it with the module. As per this, textTracks are only supported with Exo Player.
When we try to add react-native.config.js using the above config, it doesn't show any error but the app doesn't run at all nor show any logs of what's wrong.
I solved this by adding a
react-native.config.js
file to root of my project with:module.exports = { dependencies: { 'react-native-video': { platforms: { android: { sourceDir: '../node_modules/react-native-video/android-exoplayer', }, }, }, }, };
do you know a way to add AndroidTV as platforms ?
You can do this with an expo plugin now.
In your app.config.ts
file :
export default withSettingsGradle(config, (config) => {
if (config.modResults.language === 'groovy') {
if (!config.modResults.contents.includes(`:react-native-video`)) {
config.modResults.contents += `
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')`;
}
}
return config;
});
I solved this by adding a
react-native.config.js
file to root of my project with:module.exports = { dependencies: { 'react-native-video': { platforms: { android: { sourceDir: '../node_modules/react-native-video/android-exoplayer', }, }, }, }, };
But how can do the same for ios?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are having a similar problem, please open a new issue and reference this one instead of commenting on a stale or closed issue.
I solved this by adding a
react-native.config.js
file to root of my project with:module.exports = { dependencies: { 'react-native-video': { platforms: { android: { sourceDir: '../node_modules/react-native-video/android-exoplayer', }, }, }, }, };
You help my day. Thanks!!!
use type: 'title' , type: 'index' is not working in my case . use that code <Video source={{uri:LINK}} // Can be a URL or a local file. ref={refVideo} onLoad={onLoad} // onSeek={onSeek} onProgress={onProgress} resizeMode={'cover'} paused={pause} selectedTextTrack={{ type: 'title', value: 'English', }} textTracks={[ { title: 'English', language: 'es', type: TextTrackType.VTT, uri: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt', }, ]} />
Bug
Hey, I'm building an AndroidTV application using react native and I'm trying to add subtitle to my video (which is a .m3u8 file) from a url , but im not getting anything and nothing shows on screen .
*edit: I also tested it on react-native versions 0.61.2 0.61.5 0.64.0 and did not get any results.
Environment info
React native info output:
Library version: ^5.1.1
Steps To Reproduce
npm install -g @react-native-community/cli
react-native init TestApp --template=react-native-tvos
npm i react-native-video
Expected behaviour
subtitle being shown on top of the video , but nothing is shown.
Reproducible sample code
after doing all the steps , replace the content in your App.js with :