mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Disabled screenshare if token is not received
parent
2deadbbe02
commit
b29ecafea5
|
@ -238,16 +238,20 @@ export class VideoconferenceComponent implements OnInit, OnDestroy, AfterViewIni
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
set tokens(tokens: TokenModel) {
|
set tokens(tokens: TokenModel) {
|
||||||
if (!tokens || (!tokens.webcam && !tokens.screen)) {
|
if (!tokens || !tokens.webcam) {
|
||||||
//No tokens received
|
|
||||||
// throw new Error('No tokens received');
|
|
||||||
this.log.w('No tokens received');
|
this.log.w('No tokens received');
|
||||||
} else {
|
} else {
|
||||||
if (tokens.webcam || tokens.screen) {
|
this.log.w('Tokens received');
|
||||||
this.tokenService.setWebcamToken(tokens.webcam);
|
this.tokenService.setWebcamToken(tokens.webcam);
|
||||||
|
|
||||||
|
if(tokens.screen) {
|
||||||
this.tokenService.setScreenToken(tokens.screen);
|
this.tokenService.setScreenToken(tokens.screen);
|
||||||
this.canPublish = true;
|
} else {
|
||||||
|
// Hide screenshare button if screen token does not exist
|
||||||
|
this.libService.screenshareButton.next(false);
|
||||||
|
this.log.w('No screen token found. Screenshare feature will be disabled');
|
||||||
}
|
}
|
||||||
|
this.canPublish = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
*/
|
*/
|
||||||
export interface TokenModel {
|
export interface TokenModel {
|
||||||
webcam: string;
|
webcam: string;
|
||||||
screen: string;
|
screen?: string;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue