Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sampotts committed Oct 13, 2021
1 parent cf8e934 commit dca2ff8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/js/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ class Fullscreen {
return hasClass(this.target, this.player.config.classNames.fullscreen.fallback);
}

const element = !this.prefix ? this.target.getRootNode().fullscreenElement : this.target.getRootNode()[`${this.prefix}${this.property}Element`];
const element = !this.prefix
? this.target.getRootNode().fullscreenElement
: this.target.getRootNode()[`${this.prefix}${this.property}Element`];

return element && element.shadowRoot ? element === this.target.getRootNode().host : element === this.target;
}
Expand Down
17 changes: 6 additions & 11 deletions src/js/plugins/vimeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ function parseHash(url) {
* - video/{id}/{hash}
* If matched, the hash is available in the named group `hash`
*/
const regex = /^.*(?:vimeo.com\/|video\/)(?:\d+)(?:\?.*\&*h=|\/)+(?<hash>[\d,a-f]+)/
const found = url.match(regex)
const regex = /^.*(?:vimeo.com\/|video\/)(?:\d+)(?:\?.*&*h=|\/)+(?<hash>[\d,a-f]+)/;
const found = url.match(regex);

if (found) {
return found.groups.hash
}

return null
return found ? found.groups.hash : null;
}

// Set playback state and trigger change (only on actual change)
Expand Down Expand Up @@ -90,19 +86,18 @@ const vimeo = {
const player = this;
const config = player.config.vimeo;
const { premium, referrerPolicy, ...frameParams } = config;

// Get the source URL or ID
let source = player.media.getAttribute('src');
let hash = ''
let hash = '';
// Get from <div> if needed
if (is.empty(source)) {
source = player.media.getAttribute(player.config.attributes.embed.id);
// hash can also be set as attribute on the <div>
hash = player.media.getAttribute(player.config.attributes.embed.hash);
} else {
hash = parseHash(source)
hash = parseHash(source);
}
const hashParam = (!!hash) ? {h: hash} : {}
const hashParam = hash ? { h: hash } : {};

// If the owner has a pro or premium account then we can hide controls etc
if (premium) {
Expand Down

0 comments on commit dca2ff8

Please sign in to comment.