Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: use Screen Orientation API where supported #8031

Merged
merged 2 commits into from
Feb 1, 2023

Conversation

gjanblaszczyk
Copy link
Member

@gjanblaszczyk gjanblaszczyk commented Dec 3, 2022

The window "orientationchange" event is deprecated and
it should be only used when Screen Orientation API is not supported.

Description

The Text track display should use Screen Orientation "change" event and fallback to window "orientationchange" event if the Screen9 Orientation API is not supported.

Specific Changes proposed

  • introduces Screen Orientation API for detecting orientation change in TextTrackDisplay class.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

@codecov
Copy link

codecov bot commented Dec 3, 2022

Codecov Report

Merging #8031 (d795528) into main (c414d62) will decrease coverage by 0.77%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #8031      +/-   ##
==========================================
- Coverage   82.67%   81.90%   -0.78%     
==========================================
  Files         110      110              
  Lines        7342     7344       +2     
  Branches     1772     1774       +2     
==========================================
- Hits         6070     6015      -55     
- Misses       1272     1329      +57     
Impacted Files Coverage Δ
src/js/tracks/text-track-display.js 82.14% <100.00%> (+0.21%) ⬆️
src/js/control-bar/control-bar.js 83.33% <0.00%> (-16.67%) ⬇️
src/js/tech/html5.js 66.30% <0.00%> (-8.54%) ⬇️
src/js/utils/browser.js 55.76% <0.00%> (-5.77%) ⬇️
src/js/control-bar/picture-in-picture-toggle.js 79.31% <0.00%> (-3.45%) ⬇️
...rc/js/control-bar/progress-control/time-tooltip.js 82.05% <0.00%> (-2.57%) ⬇️
src/js/tech/tech.js 83.71% <0.00%> (-0.86%) ⬇️
src/js/player.js 89.76% <0.00%> (-0.40%) ⬇️

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

Copy link
Contributor

@mister-ben mister-ben left a comment

Choose a reason for hiding this comment

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

The codecov complaints are nonsense, it's got out of sync.

@gjanblaszczyk
Copy link
Member Author

Sometimes the codecov bot doesn't take my tests seriously. :)
image

@mister-ben mister-ben changed the title feat: introduces Screen Orientation API for detecting orientation change fix: use Screen Orientation API where supported Feb 1, 2023
@mister-ben mister-ben merged commit 33b476d into main Feb 1, 2023
@mister-ben mister-ben deleted the feat/screen-orientation branch February 1, 2023 17:05
edirub pushed a commit to edirub/video.js that referenced this pull request Jun 8, 2023
* feat:  introduces Screen Orientation API for detecting orientation change

* feat:  add missing unit tests
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants