ca795f298a
* feat(VideoNativeComponent.ts): add support for cmcd configuration in VideoSrc type to enable cmcd feature on android feat(video.ts): introduce CmcdMode enum and CmcdConfiguration type to define cmcd configuration options * feat(Video.tsx): add support for CMCD configuration in Video component to handle Content Management and Delivery (CMCD) headers for Android platform. * feat(CMCDProps.kt): add CMCDProps class to handle CMCD related properties and parsing logic for React Native module * feat(CMCDConfig.kt): add CMCDConfig class to handle CMCD configuration for ExoPlayer with support for custom data and configuration options. * feat(ReactExoplayerViewManager.java): add support for CMCD configuration in ReactExoplayerViewManager to enable Content Management and Control Data (CMCD) for better video playback optimization. * feat(ReactExoplayerView.java): add support for setting CmcdConfiguration.Factory to customize CMCD configuration for media playback * feat(Source.kt): add support for CMCD properties linked to the source to enhance functionality and data handling * docs(props.mdx): add documentation for configuring CMCD parameters in the component, including usage examples and default values * refactor(ReactExoplayerViewManager.java): remove unused PROP_CMCD and prevCmcdConfig variables to clean up code and improve readability * refactor(Video.tsx): simplify cmcd configuration logic for better readability and maintainability * docs(props.mdx): improve props documentation for clarity and consistency feat(props.mdx): add definitions for CmcdMode enum and CmcdData type to enhance understanding of CMCD data structure and usage * refactor(CMCDProps.kt): refactor CMCDProps class to data class for improved readability and immutability - update CMCDProps class to use List instead of Array for properties * refactor(Video.tsx): refactor createCmcdHeader function to improve code readability and reduce duplication * fix(CMCDProps.kt): remove import statement for CmcdConfiguration * feat(ReactExoplayerView.java): add support for CMCD configuration in ReactExoplayerView component feat(ReactExoplayerViewManager.java): remove redundant CMCD configuration logic from ReactExoplayerViewManager to simplify code and improve maintainability * fix(Video.tsx): merge _cmcd memo into src memo for optimization |
||
---|---|---|
.. | ||
src/main | ||
.editorconfig | ||
build.gradle | ||
gradle.properties | ||
lint.xml | ||
README.md |
react-native-video - ExoPlayer
This is an Android React Native video component based on ExoPlayer v2.
ExoPlayer is an application level media player for Android. It provides an alternative to Android’s MediaPlayer API for playing audio and video both locally and over the Internet. ExoPlayer supports features not currently supported by Android’s MediaPlayer API, including DASH and SmoothStreaming adaptive playbacks. Unlike the MediaPlayer API, ExoPlayer is easy to customize and extend, and can be updated through Play Store application updates.
https://github.com/google/ExoPlayer
Benefits over react-native-video@0.9.0
:
- Android Video library built by Google, with a lot of support
- Supports DASH, HLS, & SmoothStreaming adaptive streams
- Supports formats such as MP4, M4A, FMP4, WebM, MKV, MP3, Ogg, WAV, MPEG-TS, MPEG-PS, FLV and ADTS (AAC).
- Fewer device specific issues
- Highly customisable
ExoPlayer only props
render() {
return (
<Video
...
disableFocus={true} // disables audio focus and wake lock (default false)
onAudioBecomingNoisy={this.onAudioBecomingNoisy} // Callback when audio is becoming noisy - should pause video
onAudioFocusChanged={this.onAudioFocusChanged} // Callback when audio focus has been lost - pause if focus has been lost
/>
)
}
onAudioBecomingNoisy = () => {
this.setState({ pause: true })
}
onAudioFocusChanged = (event: { hasAudioFocus: boolean }) => {
if (!this.state.paused && !event.hasAudioFocus) {
this.setState({ paused: true })
}
}
Unimplemented props
- Expansion file -
source={{ mainVer: 1, patchVer: 0 }}