f4cce2ecdb
* feat: implement opacity to control visibility of subtitles implemented per discussion on https://github.com/react-native-video/react-native-video/issues/3579 updated docs and linked onTextTrackDataChanged to the subtitle style to clarify intent on how to control visibility. * chore: update type so that we use a union of 0 1 vs any number * chore: run ktlint to get rid of white spaces * feat: add ability to have range of numbers for opacity; while, 0 will still not render the subtitles. added util function for safeGetFloat updated types * feat: add ability to suppress subtitles with opacity 0 add data structure for subtitle styles for extensibility * chore: run yarn check-ios * chore: update documentation to clarify differences between android and ios * Update android/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java Co-authored-by: Olivier Bouillet <62574056+freeboub@users.noreply.github.com> --------- Co-authored-by: Olivier Bouillet <62574056+freeboub@users.noreply.github.com> |
||
---|---|---|
.github | ||
android | ||
docs | ||
examples | ||
ios | ||
scripts | ||
src | ||
windows | ||
.eslintignore | ||
.eslintrc | ||
.gitignore | ||
.nvmrc | ||
.prettierrc | ||
.release-it.json | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
package.json | ||
react-native-video.podspec | ||
README.md | ||
tsconfig.build.json | ||
tsconfig.json |
react-native-video
🎬 <Video>
component for React Native
Note: version 5.2.1 won't have any updates. We are currently working on making a 6.0.0 fully stable
Documentation
documentation is available at react-native-video.github.io/react-native-video
if you find some issue with new version, don't hesitate to open a ticket! Also Old version can be found here
Usage
// Load the module
import Video, {VideoRef} from 'react-native-video';
// Within your render function, assuming you have a file called
// "background.mp4" in your project. You can include multiple videos
// on a single screen if you like.
const VideoPlayer = () => {
const videoRef = useRef<VideoRef>(null);
const background = require('./background.mp4');
return (
<Video
// Can be a URL or a local file.
source={background}
// Store reference
ref={videoRef}
// Callback when remote video is buffering
onBuffer={onBuffer}
// Callback when video cannot be loaded
onError={onError}
style={styles.backgroundVideo}
/>
)
}
// Later on in your styles..
var styles = StyleSheet.create({
backgroundVideo: {
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
},
});
Supported by
📱 TWG provides both free and commercial support for this project. Feel free to contact us 🤝 to build something awesome together! 🚀