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

fix: cleanup window listeners #15

Merged
merged 2 commits into from
Aug 11, 2017
Merged

Conversation

brandonocasey
Copy link
Contributor

feat: Convert to advanced plugin

feat: Convert to advanced plugin

// register the plugin with video.js
videojs.registerPlugin('vr', vr);
VR.prototype.requestAnimationFrame = Component.prototype.requestAnimationFrame;
Copy link
Contributor Author

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

@brandonocasey brandonocasey mentioned this pull request Aug 10, 2017
Copy link
Member

@misteroneill misteroneill left a 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));
Copy link
Member

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.

Copy link
Contributor Author

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});
Copy link
Member

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! 😆

Copy link
Contributor Author

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

Copy link
Member

@misteroneill misteroneill left a 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.

@brandonocasey brandonocasey merged commit d3e45ad into master Aug 11, 2017
@brandonocasey brandonocasey deleted the fix/cleanup-window-listeners branch August 11, 2017 17:59
mister-ben pushed a commit to mister-ben/videojs-vr that referenced this pull request Dec 4, 2023
chore: Swap webvr for webxr polyfill packages (PR fix ups - adding 180 top/bottom)
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.

2 participants