-
Notifications
You must be signed in to change notification settings - Fork 37
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
[PLAYER-19] keybinding (post refacto dialog) #82
Conversation
7c18672
to
6a5b918
Compare
61e4dd6
to
1cb706b
Compare
7c82442
to
ca11d54
Compare
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.
Added a category for API manager exposed fn => window.player.media.mute()
@@ -88,17 +87,6 @@ module.exports = class DeviceRenderer { | |||
// last accessed x/y position | |||
this.x = 0; | |||
this.y = 0; | |||
|
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.
Click handler handle has been move to overlayplugin class (decoupling)
src/DeviceRenderer.js
Outdated
@@ -486,10 +475,6 @@ module.exports = class DeviceRenderer { | |||
this.mouseEvents.addMouseCallbacks(); | |||
} | |||
|
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.
decoupling see above
@@ -127,7 +127,7 @@ module.exports = class FingerPrint extends OverlayPlugin { | |||
|
|||
// register callback | |||
this.instance.registerEventCallback('fingerprint', (message) => this.handleFingerprintEvent(message)); | |||
if (this.instance.store.getState().isWebRTCConnectionReady) { |
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.
getState was unecessary for a little store,
@@ -20,6 +20,18 @@ module.exports = class Fullscreen { | |||
this.instance.addListener(document, 'fullscreenchange', this.onFullscreenEvent.bind(this), false); | |||
} | |||
|
|||
this.instance.apiManager.registerFunction({ |
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.
Requested from socis
this.isListenerAdded = false; | ||
this.currentlyPressedKeys = new Map(); | ||
|
||
this.instance.store.subscribe(({isKeyboardEventsEnabled}) => { | ||
this.transmitKeys = isKeyboardEventsEnabled; | ||
if (isKeyboardEventsEnabled) { |
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.
little refact to decoupling keyboard handle events of deviceRenderer js
this.instance.video.isMuted = true; | ||
this.instance.video.muted = true; | ||
this.instance.apiManager.registerFunction({ | ||
name: 'mute', |
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.
added category
@@ -20,6 +20,7 @@ module.exports = class MouseEvents { | |||
|
|||
this.leftButtonPressed = false; | |||
this.boundEventListener = this.releaseAtPreviousPositionEvent.bind(this); | |||
this.removeMouseUpListener = () => {}; |
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.
removeMouseUplistener will never be undefined
@@ -26,6 +26,13 @@ module.exports = class OverlayPlugin { | |||
this.closeOverlay(); | |||
} | |||
}); | |||
|
|||
// Attach listener for first object created only | |||
if (!OverlayPlugin.hasBeenCalled) { |
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.
it's a kind of static method for a Class, this way we attach the listener only once
4f8f8a9
to
97c8341
Compare
cfb37ab
to
3e80de7
Compare
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.
This is looking great. Most of my comments are about documentation, since this feature is a bit complicated to understand, I think it benefits from being as documented as possible.
I didn't much review the debug stuff (grid and trace), since I trust you that it works well enough.
1a73030
to
f9f7af6
Compare
a0e1503
to
9cc3cb4
Compare
Description
Adding keymapping feature. Somes refacto over the store, handle events, ... was recommended or necessery.
I have left some comments to helping to review.
Gesture handle
Config
You can find some json config example at the top of keymapping plugin file. Cooordonate are always in percent
Api added
v1
Type of change
Checklist