-
Notifications
You must be signed in to change notification settings - Fork 149
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
fix: cleanup window listeners #15
Conversation
feat: Convert to advanced plugin
d3a2253
to
edf450c
Compare
|
||
// register the plugin with video.js | ||
videojs.registerPlugin('vr', vr); | ||
VR.prototype.requestAnimationFrame = Component.prototype.requestAnimationFrame; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using these rather than window for auto cleanup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple tiny things, mostly LGTM.
src/plugin.js
Outdated
|
||
// if the current type has a case insensitivie match from the list above | ||
// this is hls | ||
return hlsTypes.some((type) => (new RegExp(type, 'i')).test(currentType)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this either be type.toLowerCase() === currentType.toLowerCase()
or alternately new RegExp(
^${type}$, 'i')
? My concern is that we'd get false matches for things that include these as part of the currentType
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we should probably do a full match here
src/plugin.js
Outdated
this.vrDisplay = displays[0]; | ||
this.log(this.vrDisplay); | ||
} else { | ||
this.triggerError({code: 'web-vr-no-devices-found', dismiss: false}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few cases where this is being called as triggerError
, but it appears the function is triggerError_
. It seems it would... ironically... trigger an error! 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, yeah must have failed to convert the name over when I switched in it all places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of hard to review, but looks like 90% of it is player.vr
-> this
. Regardless, LGTM.
chore: Swap webvr for webxr polyfill packages (PR fix ups - adding 180 top/bottom)
feat: Convert to advanced plugin