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]: Android Cache fails on Loaded Resource #4243

Closed
lovegaoshi opened this issue Oct 18, 2024 · 3 comments · Fixed by #4304
Closed

[BUG]: Android Cache fails on Loaded Resource #4243

lovegaoshi opened this issue Oct 18, 2024 · 3 comments · Fixed by #4304
Labels
Accepted Issue is confirmed and accepted by maintainers team bug Platform: Android Repro Provided Waiting for Review

Comments

@lovegaoshi
Copy link
Contributor

Version

6.7.0

What platforms are you having the problem on?

Android

System Version

any

On what device are you experiencing the issue?

Real device, Simulator

Architecture

Old architecture

What happened?

loaded resource require("./asset/path") will fail to load in production when cache enables. this is because with cache enabled, RNV will attempt to load resources as http and a local res URI will be a malformed URI.

one solution could be an isUriLocalFile function, and use DefaultDataSource accordingly instead of http.

logs:

12526-12691 ExoPlayerImplInternal   com.noxplay.noxplayer                E  Playback error
                                                                                                      androidx.media3.exoplayer.ExoPlaybackException: Source error
                                                                                                          at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:736)
                                                                                                          at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:708)
                                                                                                          at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                                          at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                          at android.os.Looper.loop(Looper.java:294)
                                                                                                          at android.os.HandlerThread.run(HandlerThread.java:67)
                                                                                                      Caused by: androidx.media3.datasource.HttpDataSource$HttpDataSourceException: Malformed URL
                                                                                                          at androidx.media3.datasource.okhttp.OkHttpDataSource.makeRequest(OkHttpDataSource.java:369)
                                                                                                          at androidx.media3.datasource.okhttp.OkHttpDataSource.open(OkHttpDataSource.java:262)
                                                                                                          at androidx.media3.datasource.TeeDataSource.open(TeeDataSource.java:54)
                                                                                                          at androidx.media3.datasource.cache.CacheDataSource.openNextSource(CacheDataSource.java:802)
                                                                                                          at androidx.media3.datasource.cache.CacheDataSource.open(CacheDataSource.java:615)
                                                                                                          at androidx.media3.datasource.StatsDataSource.open(StatsDataSource.java:86)
                                                                                                          at androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1045)

Reproduction Link

the example app

Reproduction

run the example app in production with cache on, and load the local file

@lovegaoshi lovegaoshi added the bug label Oct 18, 2024
Copy link

Thank you for your bug report. We will review it and get back to you if we need more information.

@freeboub
Copy link
Collaborator

@lovegaoshi on js side we already have a property indicating if it is a local file (isAsset if I remember well). It would be easier to use this one !

Copy link

This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.

@github-actions github-actions bot added the stale Closed due to inactivity or lack or resources label Nov 18, 2024
@freeboub freeboub added Accepted Issue is confirmed and accepted by maintainers team and removed stale Closed due to inactivity or lack or resources labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue is confirmed and accepted by maintainers team bug Platform: Android Repro Provided Waiting for Review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants