forked from jitsi/jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(remotecontrol): announce remotecontrol support
- Loading branch information
1 parent
896650d
commit 0f33e59
Showing
9 changed files
with
168 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* global APP, config */ | ||
import Controller from "./Controller"; | ||
import Receiver from "./Receiver"; | ||
|
||
/** | ||
* Implements the remote control functionality. | ||
*/ | ||
class RemoteControl { | ||
/** | ||
* Constructs new instance. Creates controller and receiver properties. | ||
* @constructor | ||
*/ | ||
constructor() { | ||
this.controller = new Controller(); | ||
this.receiver = new Receiver(); | ||
this.enabled = false; | ||
this.initialized = false; | ||
} | ||
|
||
/** | ||
* Initializes the remote control - checks if the remote control should be | ||
* enabled or not, initializes the API module. | ||
*/ | ||
init() { | ||
if(config.disableRemoteControl || this.initialized) { | ||
return; | ||
} | ||
this.initialized = true; | ||
APP.API.init({ | ||
forceEnable: true, | ||
}); | ||
this.controller.enable(true); | ||
} | ||
|
||
/** | ||
* Handles API event for support for executing remote control events into | ||
* the wrapper application. | ||
* @param {boolean} isSupported true if the receiver side is supported by | ||
* the wrapper application. | ||
*/ | ||
onRemoteControlSupported(isSupported) { | ||
if(isSupported && !config.disableRemoteControl) { | ||
this.enabled = true; | ||
if(this.initialized) { | ||
this.receiver.enable(true); | ||
} | ||
} | ||
} | ||
} | ||
|
||
export default new RemoteControl(); |
Oops, something went wrong.