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

feat: add compatibility layer for video.js 7 and 8 #1322

Merged
merged 4 commits into from
Aug 24, 2022
Merged

Conversation

misteroneill
Copy link
Member

@misteroneill misteroneill commented Aug 24, 2022

Description

There will be a few functions in Video.js deprecated in 8.0 including videojs.mergeOptions and videojs.createTimeRanges. Both functions still work, but will log a deprecation warning. We do not want to log deprecation warnings out of the box, so with this PR we call the new methods via a small utility module, vjs-compat.

Tested with both Video.js 7.x and Video.js next branch.

Specific Changes proposed

  • Add util/vjs-compat with two functions:
  • merge, which delegates to videojs.obj.merge, falling back to videojs.mergeOptions
  • createTimeRanges, which delegates to videojs.time.createTimeRanges, falling back to videojs.createTimeRanges
  • Removes old Video.js 4.x-style plugin registration via videojs.plugin()
  • Updates dev dependency, videojs-contrib-eme, so that it will not log deprecation warnings in tests.

Requirements Checklist

  • Feature implemented / Bug fixed
  • Reviewed by Two Core Contributors

@misteroneill misteroneill changed the base branch from main to next August 24, 2022 18:46
@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #1322 (0822e79) into next (8954a40) will increase coverage by 0.00%.
The diff coverage is 92.45%.

@@           Coverage Diff           @@
##             next    #1322   +/-   ##
=======================================
  Coverage   85.97%   85.98%           
=======================================
  Files          39       40    +1     
  Lines        9820     9826    +6     
  Branches     2286     2289    +3     
=======================================
+ Hits         8443     8449    +6     
  Misses       1377     1377           
Impacted Files Coverage Δ
src/source-updater.js 94.19% <50.00%> (ø)
src/playlist-loader.js 95.00% <80.00%> (ø)
src/media-segment-request.js 95.40% <83.33%> (ø)
src/dash-playlist-loader.js 90.05% <100.00%> (ø)
src/media-groups.js 98.66% <100.00%> (ø)
src/playlist-controller.js 94.98% <100.00%> (ø)
src/playlist.js 94.53% <100.00%> (-0.03%) ⬇️
src/ranges.js 99.34% <100.00%> (ø)
src/reload-source-on-error.js 97.72% <100.00%> (ø)
src/segment-loader.js 96.37% <100.00%> (ø)
... and 4 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@misteroneill misteroneill merged commit b9d26e5 into next Aug 24, 2022
@misteroneill misteroneill deleted the feat/vjs-compat branch August 24, 2022 20:57
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.

3 participants