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

chore: Miscellaneous cleanups #126

Merged
merged 3 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ Version 1.x requires video.js 8.x as a peer dependency. Lowever video.js version
exitOnRotate: true,
lockOnRotate: true,
lockToLandscapeOnEnter: false,
iOS: false,
disabled: false
},
touchControls: {
Expand All @@ -73,7 +72,7 @@ Version 1.x requires video.js 8.x as a peer dependency. Lowever video.js version
- *touchControls.seekSeconds* `int` Seconds to seek when double-tapping
- *touchControls.tapTimeout* `int` Milliseconds to consider a double-tap
- *touchControls.disableOnEnd* `boolean` Whether to disable touch controls when the video has ended, e.g. if an endscreen is used. Automatically disables if the endscreen plugin is present when this plugin initialises
- *touchControls.disableOnEnd* `boolean` If true no touch controls are added.
- *touchControls.disabled* `boolean` If true no touch controls are added.

## Usage

Expand Down
6 changes: 2 additions & 4 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const screen = window.screen;
* @return {string} orientation
*/
const getOrientation = () => {
if (window.screen) {
if (screen) {
// Prefer the string over angle, as 0° can be landscape on some tablets
const orientationString = ((window.screen.orientation || {}).type || window.screen.mozOrientation || window.screen.msOrientation || '').split('-')[0];
const orientationString = ((screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation || '').split('-')[0];

if (orientationString === 'landscape' || orientationString === 'portrait') {
return orientationString;
Expand Down Expand Up @@ -163,8 +163,6 @@ const onPlayerReady = (player, options) => {
* @param {boolean} [options.fullscreen.lockToLandscapeOnEnter=false]
* Whether to always lock orientation to landscape on fullscreen mode
* Unlocked when exiting fullscreen or on 'ended'
* @param {boolean} [options.fullscreen.iOS=false]
* Deprecated: Whether to disable iOS's native fullscreen so controls can work
* @param {Object} [options.touchControls={}]
* Touch UI options.
* @param {boolean} [options.touchControls.disabled=false]
Expand Down