TheWidlarzGroup / react-native-video

A <Video /> component for react-native
http://thewidlarzgroup.github.io/react-native-video/
MIT License
7.16k stars 2.89k forks source link

Android 7.1.1 Nougat (API 25) ABI x86_64 not playing Video #672

Closed anshul-kai closed 6 years ago

anshul-kai commented 7 years ago

Videos aren't playing on Android Nougat (API 25) ABI x86_64. Could this be an issue across all 64-bit ABIs?

michaelspeed commented 7 years ago

this is a problem i am facing! actually the app freezes for sometime before playing the video. but then it starts

michaelspeed commented 7 years ago

07-03 03:26:04.061 16603-16603/com.atmiyo W/MediaPlayer: setScreenOnWhilePlaying(true) is ineffective without a SurfaceHolder 07-03 03:26:04.062 16603-16603/com.atmiyo W/MediaPlayer: Couldn't open https://firebasestorage.googleapis.com/v0/b/xxxx: java.io.FileNotFoundException: No content provider: https://firebasestorage.googleapis.com/v0/b/xxxx 07-03 03:26:14.355 16603-16603/com.atmiyo W/MediaPlayer: Couldn't open https://firebasestorage.googleapis.com/v0/b/xxxx: java.io.FileNotFoundException: No content provider: https://firebasestorage.googleapis.com/v0/b/xxxx 07-03 03:26:24.603 16603-16603/com.atmiyo W/MediaPlayer: setScreenOnWhilePlaying(true) is ineffective for Surface 07-03 03:26:24.675 16603-16603/com.atmiyo I/Choreographer: Skipped 1236 frames! The application may be doing too much work on its main thread.

them again it starts playing!!! anyone knows why its skipping? this problem does not exist in iOS

michaelspeed commented 7 years ago

this solves while using exoplayer

manuTro commented 7 years ago

@michaelspeed I also solved by using exoplayer, but now I cannot see the video, just a black window, and from my log I have com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 401. Did you got the same?

michaelspeed commented 7 years ago

well sometimes it works and sometimes i get the same error with a black screen. i checked it with ios version and no issues there

anshul-kai commented 7 years ago

Using ExoPlayer solves my problem guys. I don't see any black windows. Want to share your code?

manuTro commented 7 years ago

@a-koka I'm using clojurescript, but if you want I can share it.. However my code works fine by using react-navive-video without exoplayer, just the app freeze before show the video (but at the least I can see the video). I added exoplayer in this way : settings.grandle

//include ':react-native-video'
// project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')
//project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')

include ':app'
include ':react-native-fs'

include ':react-native-video-exoplayer'
project(':react-native-video-exoplayer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android')

build.grandle

    // compile project(':react-native-video')
  compile project(':react-native-video-exoplayer')
    compile project(':react-native-fs')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

Is it right?

anshul-kai commented 7 years ago

This is how my settings.gradle looks. I didn't make any change to build.gradle.

include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')

I haven't tried your approach of renaming the project but I can't image why it would work any different. I'm not having any issues with a black screen though. Did you implement the hack to update paused via onLoad? There are few threads discussing this. One is here.

Here's a snippet of how to hack paused:

_onload() {
  this.setState({paused: !paused}, () => this.setState({plapausedying}))
}

<Video source={{uri}}
    volume={1.0}
    muted={false}
    paused={!paused}
    onLoad={this._onLoad.bind(this)} />
manuTro commented 7 years ago

@a-koka For now I didn't implemented the onLoad callback.. but I think my problem is about cookies because I got this response com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 401. .I opened this issue https://github.com/react-native-community/react-native-video/issues/683

cobarx commented 6 years ago

ExoPlayer cookie support will be included in 2.2.0