Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local video file doesn't play on Android release app #1324

Closed
Solitaryo opened this issue Nov 12, 2018 · 10 comments
Closed

local video file doesn't play on Android release app #1324

Solitaryo opened this issue Nov 12, 2018 · 10 comments
Labels
stale Closed due to inactivity or lack or resources

Comments

@Solitaryo
Copy link

Current behavior

I have several local files that I'm loading in the app, on different screens. The thing is, in emulator works perfect, and if I run the app directly in the Android device, the video works, BUT, once I build the release app, the video doesn't show, is just a black view, with nothing working.

Reproduction steps

A 1, 2, 3, etc. list of what's needed to see the issue happen.

  1. require local file: const video = require('../assets/videos/video1.mp4');
  2. put the video in react-native player:
    <Video style={styles.video} source={video} repeat muted={true} fullscreen={false} resizeMode="cover" bufferForPlaybackMs={500} />
  3. buid signed APK, and load the app in a device, video is not showing.

Expected behavior

The video should show.

Platform

Which player are you experiencing the problem on:

  • Android. Tested on Moto E5, Google Pixel 2 XL and Samsung Galaxy Note 8.

More Info:

"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.3",
"react-native-video": "^3.2.0",

Building the app on:
macOS High Sierra 10.13.6
Android Studio 3.1.4

@cokealmonacid
Copy link

Hi! did you find any solution to this problem?

@godza
Copy link

godza commented Mar 12, 2019

This happens in IOS also.

@cagataykapuagasi
Copy link

Same issue

@romainbraun
Copy link

In my case I fixed it by using the old Android Media Player, replacing:

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

with

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

@smismailalam
Copy link

Hello, Same issue
did anybody find any solution to this problem?

@Neha0595
Copy link

Neha0595 commented May 8, 2019

This happens in both android and IOS, I copied media files in my project directory as well,
<Video
repeat
source={require('../assets/videos/myvideo.mp4)}
resizeMode="cover"
style={{ flex: 1 }}
paused={false}
/>
But show black screen in both android and ios as well

@r0b0t3d
Copy link
Contributor

r0b0t3d commented Nov 7, 2019

It seems like there is issue with video files inside assets folder facebook/metro#290
I moved my video file outside assets folder and it works.
You guys may give it a try

@syedamirali14
Copy link

maybe it's video format issue
did you check this format of video?
codec: AAC, H.264
colour profile: HD (1-1-1)

@jeremyfrancis
Copy link

Works fine on fullscreen, but when putting it in a view on Android, the audio plays, but there is nothing on the screen! In the emulator in debug it shows up, but in production it is blank with just the audio.

iOS works great.

I tried putting the video outside of the assets folder, no luck.

Anymore solutions?

@jeremyfrancis
Copy link

Works fine on fullscreen, but when putting it in a view on Android, the audio plays, but there is nothing on the screen! In the emulator in debug it shows up, but in production it is blank with just the audio.

iOS works great.

I tried putting the video outside of the assets folder, no luck.

Anymore solutions?

OK I feel dumb. My solution was obvious. My video files are .mov format and obviously Android does not support .mov because Apple made it. Converted to .mp4 and walla.

@hueniverse hueniverse added the stale Closed due to inactivity or lack or resources label Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Closed due to inactivity or lack or resources
Projects
None yet
Development

No branches or pull requests