react-native-video/android
yungblud b33e6df496
Fabric (New Architecture) codegen support (#3487)
* feat: implemented codegenConfig on package.json

* chore: moved directory location of Fabric component

* fix: typefix FabricExample

* chore: pod instaslled FabricExample iOS app

* feat: implemented codegen config on package.json

* feat: implemented codegen of specs/VideoNativeComponent

* chore: removed not using type Filter

* feat: removed unnecessary export on codegen tyepes

* Revert "feat: removed unnecessary export on codegen tyepes"

This reverts commit fc243b0ac5c565eda4886cd865c32ba4e812d7ff.

* refactor: fixed types on Video component and modified types with codegen types

* feat: modified codegenNativeComponent naming (RCTVideo)

* feat: pod installed example basic app

* feat: bump up react-native dev dependency version to 0.73.2 for supporting codegen array event params

* feat: support array param types on event callback function codegen types

* chore: pod installed ios basic example

* feat: modified source prop as optional type

* feat: add original src/VideoComponent.ts again

* Revert "feat: add original src/VideoComponent.ts again"

This reverts commit d63ac94e5330f7c7fb50374f65f8f3f4e0a225d7.

* feat: add original src/VideoComponent.ts again with original file name

* feat: git rm src/specs/VideoNativeComponent.ts

* feat: git mv VideoNativeComponent.ts

* feat: git mv src/specs/VideoNativeComponent.ts

* feat: git mv src/VideoNativeComponent.ts src/specs/VideoNativeComponent.ts

* feat: implemented array type handling on android JAVA

* feat: updated iOS requestHeaders parsing native

* feat: use safeGetArray on android, removed not using import too

* feat: temporary commit - reusing enum types for remaining docs types

* feat: implemented mixed type of SelectedTrack.value for JS layer
2024-03-07 11:35:17 +01:00
..
src/main Fabric (New Architecture) codegen support (#3487) 2024-03-07 11:35:17 +01:00
.editorconfig chore: lint project (#3395) 2023-12-07 08:47:40 +01:00
build.gradle fix(android): add explicitly dependancy to androidx.activity (#3410) 2023-12-08 11:33:29 +01:00
gradle.properties fix(android): add explicitly dependancy to androidx.activity (#3410) 2023-12-08 11:33:29 +01:00
lint.xml feat(android): bump media3 version from v1.1.1 to v1.2.0 (#3362) 2023-11-20 08:20:27 +01:00
README.md chore: move android-exoplayer to android folder 2022-06-15 22:30:24 +02: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 }}