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

Add support for ogv.js in video player #259

Merged
merged 2 commits into from
Jul 4, 2024
Merged

Add support for ogv.js in video player #259

merged 2 commits into from
Jul 4, 2024

Conversation

dan-niles
Copy link
Collaborator

@dan-niles dan-niles commented Jul 2, 2024

In this PR, I added ogv.js as a fallback to video-js for webm playback on unsupported browers. The changes are as follows:

  • Setup videojs-ogvjs tech plugin in video-js (Custom script taken from here)
  • Remove openzim.toml since all the dependencies for the UI are now managed using Yarn.
  • Setup vite-plugin-static-copy to copy ogvjs files from node_modules into the final build/dist folder. (This is needed because the videojs-ogvjs tech plugin needs access to the ogvjs files at runtime)
  • Add type: "module" back to package.json and rename cypress.config.ts to cypress.config.js.

(Tested webm playback on ogvjs by removing html5 from the TechOrder option in video options.)

Close #230
Close #218

@dan-niles dan-niles self-assigned this Jul 2, 2024
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 1.63%. Comparing base (bcf700e) to head (8f24baa).

Additional details and impacted files
@@           Coverage Diff            @@
##            main    #259      +/-   ##
========================================
+ Coverage   1.61%   1.63%   +0.01%     
========================================
  Files         11      11              
  Lines       1052    1040      -12     
  Branches     159     156       -3     
========================================
  Hits          17      17              
+ Misses      1035    1023      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dan-niles dan-niles marked this pull request as ready for review July 2, 2024 15:40
@dan-niles dan-niles requested a review from benoit74 July 2, 2024 15:40
Copy link
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I have a bug with kiwix-serve reader on Firefox 127.0.2 on Mac M1 with Sonoma 14.5.

image

But it works well on same machine with Chrome 125.0.6422.142 and with Safari 17.5 (19618.2.12.11.6).

Could you have a look if you achieve to reproduce the issue on your machine and/or if you find something which could explain how to solve this? This looks a bit like an edge-case where it tries to decode audio as mpeg instead of vorbis (not even sure what is the appropriate media type for vorbis), and for some reasons Firefox is less permissive than Chrome and Safari. For convenience the ZIM will soon be available at https://dev.library.kiwix.org/viewer#tests_eng_yt-zim_2024-07 (in more or less 10 to 20 minutes)

@benoit74
Copy link
Collaborator

benoit74 commented Jul 4, 2024

Other than this small glitch, very good work!

@benoit74
Copy link
Collaborator

benoit74 commented Jul 4, 2024

Nota: Firefox issue is in fact also visible with the https://pwa.kiwix.org and with the browser extension ; pwa works well on Chrome and Safari as well

@dan-niles
Copy link
Collaborator Author

dan-niles commented Jul 4, 2024

Unfortunately I have a bug with kiwix-serve reader on Firefox 127.0.2 on Mac M1 with Sonoma 14.5.

@benoit74 I couldn't reproduce this issue. I tested on Firefox 127.0.2 on Mac M1 with Sonoma 14.5. It is working on kiwix-serve, https://pwa.kiwix.org/ and the Firefox extension for me and I didn't get the above mentioned console warnings.

I did however install a fresh copy of Firefox to do this testing. Can you check if any other extensions in your browser might be causing conflicts?

Screen.Recording.2024-07-04.at.16.02.13.mov

@benoit74
Copy link
Collaborator

benoit74 commented Jul 4, 2024

I confirm that I cannot reproduce the issue on a Browserstack machine. Disabling all extensions does not help. But anyway, for now it really looks to me like a very local problem on my machine. Let's wait for the problem to appear on another machine (hopefully not) to confirm there is a real problem ; I suspect there is no problem. And anyway switching to another browser is also not a very big deal.

@benoit74 benoit74 self-requested a review July 4, 2024 12:40
Copy link
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@benoit74 benoit74 merged commit 5ae8960 into main Jul 4, 2024
10 checks passed
@benoit74 benoit74 deleted the setup-ogvjs branch July 4, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup ogv.js as a fallback in video.js Install all JavaScript dependencies through Yarn
2 participants