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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Serving local videos occasionally fails on Android #6021
Comments
This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue. Please see the Contributing Guide for how to create a Code Reproduction. Thanks! |
Here is an example : https://github.com/brospars/bugvid Exact same bug on android emulator and real device. Sometimes videos load properly sometimes I get Edit: Sometimes I don't get the
|
Just for the sake of it I upgraded to the latest versions of everything on the The bug is still present on Android emulator (Pixel 4 API 29) and real devices, it's not happening everytime but after closing/reopening the app multiple time (once the download has ended) I get: Edit: sorry I'm adding stuff while I'm debugging // Range seems wrong : 1055736-1055735 => video bug
{Accept-Ranges=bytes, Cache-Control=no-cache, Content-Range=bytes 1055736-1055735/1055736}
// Range is correct : 0-1589247 => video works
{Accept-Ranges=bytes, Cache-Control=no-cache, Content-Range=bytes 0-1589247/1589248} This makes me think it could be coming from this part of the code : https://github.com/ionic-team/capacitor/blob/main/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java#L202-L232 |
Thanks for the sample app, but I can't reproduce. |
Hi, I mean shutting it off and on using Android Studio. And sometimes the video won't start and you can see network errors in crime dev tools. I've also added breakpoints when the range is wrong (like shown in my previous comment) but with no luck the response go through and end up in chrome WebView native code that I can't debug. |
I'm asking for the WebView version, not the Android version, it's the version you can see in chrome://inspect/#devices between brackets, i.e. for me it's WebView in io.ionic.starter (91.0.4472.114). The "shutting it off and on using Android Studio" is even more confusing. |
Sorry I misread your comment. I have the same version for the emulator |
@brospars Did you manage to solve this issue? I'm getting the same behavior but with local audio files |
@FONAU I ended up not using the html5 |
@brospars do mind sharing your code? Anytime I pass the url which is the local path that starts with 'content://' on Android it fails to play |
Ps. The fetch for |
I just noticed there are a few similar issues which just got closed but never fixed, so this seems to be a recurring problem. |
Howdy, I want to report that this problem has been happening for over a year. The issue initially started with capacitor 3. I had hopes that by upgrading to capacitor 4 (from scratch), this issue would be resolved, but it's still present when serving mp3 files. Any hopes to get a bump on PR #5956? |
Just tried with Capacitor 4.7.3 and the issue still persists as described in #5839 Anyone has a workaround? |
We use the following workaround, as described in PR #5956
|
Could you ellaborate on how to do that with local files ? |
any update? |
any update? |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Quick hint that solved it for me after hours and hours of investigation: Or to be more exact I am using |
Bug Report
Capacitor Version
Platform(s)
Android
Current Behavior
On iOS : the video plays without a problem.
On Android : the video plays but we get a network error from time to time that stop the video and "crashes" the player (we have to change page and come back to replay it again). Sometimes the video won't play at all.
Expected Behavior
The video play thoroughly on android.
Code Reproduction
We use a html5 video player in an Ionic/Angular app to play local video like such:
Where
src
is set using an input :Capacitor.convertFileSrc('video/videoXYZ.mp4')
Other Technical Details
We can have multiple videos on the same page. And the bug seems to happen more often when we seek through multiple videos quickly.
npm --version
output:8.7.0
node --version
output:v14.19.0
The text was updated successfully, but these errors were encountered: