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

[BUG]: v6.6.2 android can't play video after build, Playback error ExoPlaybackException: Source error #4195

Open
gyhyfj opened this issue Sep 24, 2024 · 6 comments
Labels
bug Missing info Some information from template are missing Platform: Android Repro Provided

Comments

@gyhyfj
Copy link

gyhyfj commented Sep 24, 2024

Version

6.6.2

What platforms are you having the problem on?

Android

System Version

12

On what device are you experiencing the issue?

Real device

Architecture

Old architecture

What happened?

I'm using react-native-video@6.6.2 on react-native@0.73.5, to display required asset video.
Everything works well on dev, but after build, video and postes can't display, with error:

E  Playback error
     androidx.media3.exoplayer.ExoPlaybackException: Source error
         at androidx.media3.exoplayer.O000O0O0OO0OO0OO00O.O000O0O0O0OO0O0O0OO(SourceFile:17)
         at androidx.media3.exoplayer.O000O0O0OO0OO0OO00O.handleMessage(SourceFile:321)
         at android.os.Handler.dispatchMessage(Handler.java:102)
         at android.os.Looper.loopOnce(Looper.java:233)
         at android.os.Looper.loop(Looper.java:344)
         at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: androidx.media3.datasource.HttpDataSource$HttpDataSourceException: Malformed URL
         at O000O0OO0OOO00O0O0O.O000O0O00OO0O0OOO0O.O000O0O00OOO0O0O0OO(SourceFile:173)
         at O000O0OO0OOO00O0O0O.O000O0O00OO0O0OOO0O.O000O0O00OO0O0OOO0O(SourceFile:12)
         at O000O0OO0OO0OO0O0O0.O000O0O00OOOO0O0O0O.O000O0O00OO0O0OOO0O(SourceFile:3)
         at androidx.media3.datasource.cache.O000O0O00OO0O0OOO0O.O000O0O00OOO0OO0O0O(SourceFile:279)
         at androidx.media3.datasource.cache.O000O0O00OO0O0OOO0O.O000O0O00OO0O0OOO0O(SourceFile:127)
         at O000O0OO0OO0OO0O0O0.O000O0O00OOO0OOO0O0.O000O0O00OO0O0OOO0O(SourceFile:13)
         at androidx.media3.exoplayer.source.O000O0O0O0O0OOO00OO$O000O0O00OO0O0OOOO0.load(SourceFile:26)
         at androidx.media3.exoplayer.upstream.Loader$O000O0O00OO0OO0OO0O.run(SourceFile:51)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
         at java.lang.Thread.run(Thread.java:1012)

Reproduction Link

repository link

Reproduction

props is:

const defaultConfig: ReactVideoProps = {
  allowsExternalPlayback: false,
  controls: false,
  disableFocus: true,
  disableDisconnectError: true, 
  focusable: false,
  fullscreenAutorotate: false,
  hideShutterView: true,
  minLoadRetryCount: 3,
  muted: true,
  pictureInPicture: false,
  playInBackground: false, 
  playWhenInactive: true, 
  preventsDisplaySleepDuringVideoPlayback: false,

  bufferConfig: /* android only */ {
    cacheSizeMB: 100,
  },
  repeat: true,
  resizeMode: 'cover',
  viewType: 1, //  TEXTURE = 0,  SURFACE = 1,  (default, cannot be animated and overlay)  SURFACE_SECURE = 2
}

source is

source={{uri:require('~/assets/test.mp4')}}
@gyhyfj gyhyfj added the bug label Sep 24, 2024
Copy link

Thank you for your issue report. Please note that the following information is missing or incomplete:

  • reproduction link

Please update your issue with this information to help us address it more effectively.

Note: issues without complete information have a lower priority

@github-actions github-actions bot added Platform: Android Missing info Some information from template are missing Repro Provided labels Sep 24, 2024
@freeboub
Copy link
Collaborator

I don't think urls with ~ are supported ...

@gyhyfj
Copy link
Author

gyhyfj commented Sep 24, 2024

@freeboub I found that remove bufferConfig can solve this problem

@gyhyfj
Copy link
Author

gyhyfj commented Sep 24, 2024

I don't think urls with ~ are supported ...

It's still available NodeRequire, transformed by babel.
However I think it's wired to pass it to uri since v6, which is different from Image componet

@freeboub
Copy link
Collaborator

@gyhyfj It looks like the issue is the following: we try to cache a local file playback, it doesn't make sense, but I agree this configuration should work in the package.
My remark was about the file path starting with ~, but if it works without bufferingConfig, it is a valid workaround

@freeboub
Copy link
Collaborator

I don't reproduce the issue with the sample app ...
Did you try to put a path without '~' inside, and with a relative path to your project ?
The error is : "Malformed URL" I really suspect an issue with your path which may not be correctly translated.

If it still not working, can you please share a sample which reproduce the issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Missing info Some information from template are missing Platform: Android Repro Provided
Projects
None yet
Development

No branches or pull requests

2 participants