-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Seeking in videos does not always work in SW mode in Chromium extension #531
Comments
This happens often, but not all the time. And it depends on the ZIM file. The "Video Error" does not give much information. |
I forgot to mention that this occurs only inside an extension. |
I reproduce the same behavior with Chrome 71 (on Windows), so it's unfortunately not a recent bug of the browser. |
Seeking seems to work in Edge 44 and, more importantly, in Edge 77 (which is Chromium-based) in SW mode, but I'm not testing this in an extension. If you want me to test Edge 77 with the Chrome extension, please remind me how to do that? But it's fine if we leave this bug-fixing to a later release. |
The issue seems specific to extensions. It would be very interesting to see if you reproduce it on Edge 77.
|
I've installed the local copy of the extension (removing -WÏP suffix) in Edge 77. Seeking works fine in SW mode in |
Interesting. Can you reproduce the issue with Chromium/Chrome? |
I actually don't have Chromium installed on this machine in order not to conflict with Edge-Chromium. However, I'm seeing if I can test it in Chromium on WSL (Ubuntu on Windows Subsystem for Linux). |
Hmm, I can't seem to get Chromium to run at all under WSL, even though Firefox for Ubuntu runs fine with an X-server running. Seems it's not possible yet. I think we'll have to leave it for now, as I'm Ok with just running Edge Chromium on this machine. |
It seems to me that I've seen it recently |
I reproduced somewhat similar issues on https://download.kiwix.org/zim/videos/voa_learning_english-word-of-the-day_2021-12.zim , where every video stops after a few frames with an error message "The media playback was aborted due to a corruption problem or because the media used features your browser did not support." I could not reproduce with https://download.kiwix.org/zim/videos/biologie-tout-compris_fr_all_2022-04.zim or https://download.kiwix.org/zim/ted/ted_en_playlist-5-questions-about-climate-change_2021-12.zim (I currently can't download big ones) |
I could reproduce the issue also with https://download.kiwix.org/zim/videos/dirtybiology_fr_all_2022-01.zim If in jQuery mode, or with Firefox, seeking backward always works properly |
From what I read in https://github.com/search?q=org%3Avideojs+MEDIA_ERR_DECODE&type=Issues and https://bugs.chromium.org/p/chromium/issues/detail?id=987951, it might depend on the OS, platform, and VideoJS version It would be interesting that someone else tries to reproduce it. VideoJS 7.8.1 is used by all these ZIM files (the ones where I reproduce the issue... but also the unaffected ones) |
@rgaudin : as I saw you handled a few other video issues on youtube and ted scrapers, could you try to reproduce this issue on your machine? Maybe I'm the only one to have the problem? |
@mossroy I just tested VOA's ZIM with 3.4.0 (Firefox) and it works fine 🤷♂️ |
Thanks, but can you try with a Chromium-based browser (Chrome or Edge), from the browser extension, and in ServiceWorker mode? It's the combination that triggers the issue for me |
Indeed it's not working with Chrome… |
But it's working fine with the same Chrome when executed outside an extension. |
I tested to force a VideoJS upgrade without modifying the ZIM file (branch https://github.com/kiwix/kiwix-js/tree/upgrade-videojs-quirk : I inject the new version through our ServiceWorker) |
After injecting the non-minified version of VideoJS 7.19.2, I could put breakpoints in it, but it did not give me much more information.
And afterwards errors saying:
Full JSON export of that: This log appears ~ 5 seconds after starting the video of "sit (verb)" from https://download.kiwix.org/zim/videos/voa_learning_english-word-of-the-day_2021-12.zim |
I'ts curious that it works in JQuery mode but not in SW mode in the extension only. What are the technical differences in how we extract the video? My understanding:
On the other hand, the fact that it works in Chromium outside of an extension appears to point to the idea that some crucial bit of playback JavaScript is inline (the only thing that is specifically blocked in an extension). This piece of JS must somehow deal with keeping track of the position of the video stream. Sorry this isn't terribly helpful, it's just an attempt to visualize mentally what is going on. |
Would you support a pragmatic solution of detecting that we are in a Chromium extension in SW mode, and so we use the blob: technique of extracting the video? I realize it creates technical debt... |
Another data point: I can reproduce this issue in the Kiwix JS Windows Electron app (https://download.kiwix.org/nightly/2022-06-03/). |
Correction: the Electron app doesn't run as a Chromium extension (that's NWJS). The Electron app instead runs from the file:// protocol. This suggests the issue is possibly a Caching one? |
Currently, our javascript backend does not support reading chunks of the video. So when the browser requests a chunk, we always send the whole video. That might change with upcoming libzim backend The "media-internals" log tends to say it would be a low-level video decoding issue (thrown by Chromium itself, in the C code that decodes webm). But I don't see why it only occurs in an extension
You mean that it could come from the fact that we can't use the Cache API in extensions, and might have to re-read the ZIM file many times? That's possible, thanks for the idea. I'll investigate
Not for now. |
It's just one thing in common between the Chromium extension of Kiwix JS and the Electron app of Kiwix JS Windows: neither can use Cache API. However, we don't store a video in Cache in any case, only assets, so I'm not sure if it's relevant. It would be interesting as an experiment to see whether temporarily caching the video file in a memory-based cache solves the issue so it's not called from the ZIM each time a user tries to skip forward or back. I'm talking about monkey-rigging a diagnostic experiment just to see if latency is the issue, not necessarily to offer that as a solution. |
I've added some debug logs in the ServiceWorker, and tested with https://download.kiwix.org/zim/videos/voa_learning_english-word-of-the-day_2021-12.zim |
I'm making progress. I think it's related to range/byte-range/content-length headers and maybe the response HTTP code (200 or 206) |
* Send requested byte range from SW, with correct headers Fixes #531 * Improve comments * Ignore end offset of requested range * Remove debug logs and apply review remarks * Remove unused variable, thanks codefactor
@rgaudin, a PR has been merged that should fix the issue. Could you test again tomorrow with the nightly build? (or today from source) |
@mossroy, it works great with |
Cool, thanks for your test! |
With kiwix-js 2.5.0 or latest code, and with Chromium 75.
It fails with "Video Error" in the console, and the video is stuck with a spinner on it.
I did not notice this issue in older versions of Chromium.
I think we should try to fix this before releasing a version 2.6 (#525)
The text was updated successfully, but these errors were encountered: