react-native-video/android-exoplayer
Tai Le Tuan daf5e595ec
feat: upgrade exoplayer to v2.17.1 (#2498)
Describe the changes
Upgrade ExoPlayer to version 2.17.1

Provide an example of how to test the change
Tested with a forked of react-native-video-test

* Update exoplayer to v2.15.1

* feat: upgrade ExoPlayer to version 2.17.1

* chore: update CHANGELOG

* remove ExoPlayerFullscreenVideoActivity

* Fix build issues

* Fix build & runtime issues

Co-authored-by: Eran Hammer <eran@hammer.io>
Co-authored-by: Armands Malejev <armands.malejevs@gmail.com>
2022-06-15 10:24:55 -07:00
..
src/main feat: upgrade exoplayer to v2.17.1 (#2498) 2022-06-15 10:24:55 -07:00
build.gradle feat: upgrade exoplayer to v2.17.1 (#2498) 2022-06-15 10:24:55 -07:00
README.md Fix 'HlS' > 'HLS' (UPPERCASE) 2022-05-21 03:34:24 +07:00

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 Androids MediaPlayer API for playing audio and video both locally and over the Internet. ExoPlayer supports features not currently supported by Androids 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 }}