mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Added event types
parent
3b986dcfaa
commit
2deadbbe02
|
@ -26,7 +26,10 @@ import { ChatMessage } from '../../models/chat.model';
|
||||||
import { ParticipantService } from '../../services/participant/participant.service';
|
import { ParticipantService } from '../../services/participant/participant.service';
|
||||||
import { PanelType } from '../../models/panel.model';
|
import { PanelType } from '../../models/panel.model';
|
||||||
import { OpenViduAngularConfigService } from '../../services/config/openvidu-angular.config.service';
|
import { OpenViduAngularConfigService } from '../../services/config/openvidu-angular.config.service';
|
||||||
import { ToolbarAdditionalButtonsDirective, ToolbarAdditionalPanelButtonsDirective } from '../../directives/template/openvidu-angular.directive';
|
import {
|
||||||
|
ToolbarAdditionalButtonsDirective,
|
||||||
|
ToolbarAdditionalPanelButtonsDirective
|
||||||
|
} from '../../directives/template/openvidu-angular.directive';
|
||||||
import { ParticipantAbstractModel } from '../../models/participant.model';
|
import { ParticipantAbstractModel } from '../../models/participant.model';
|
||||||
import { PlatformService } from '../../services/platform/platform.service';
|
import { PlatformService } from '../../services/platform/platform.service';
|
||||||
|
|
||||||
|
@ -117,22 +120,49 @@ export class ToolbarComponent implements OnInit, OnDestroy {
|
||||||
/**
|
/**
|
||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
@ContentChild(ToolbarAdditionalPanelButtonsDirective)
|
@ContentChild(ToolbarAdditionalPanelButtonsDirective)
|
||||||
set externalAdditionalPanelButtons(externalAdditionalPanelButtons: ToolbarAdditionalPanelButtonsDirective) {
|
set externalAdditionalPanelButtons(externalAdditionalPanelButtons: ToolbarAdditionalPanelButtonsDirective) {
|
||||||
// This directive will has value only when ADDITIONAL PANEL BUTTONS component tagget with '*ovToolbarAdditionalPanelButtons' directive
|
// This directive will has value only when ADDITIONAL PANEL BUTTONS component tagget with '*ovToolbarAdditionalPanelButtons' directive
|
||||||
// is inside of the TOOLBAR component tagged with '*ovToolbar' directive
|
// is inside of the TOOLBAR component tagged with '*ovToolbar' directive
|
||||||
if (externalAdditionalPanelButtons) {
|
if (externalAdditionalPanelButtons) {
|
||||||
this.toolbarAdditionalPanelButtonsTemplate = externalAdditionalPanelButtons.template;
|
this.toolbarAdditionalPanelButtonsTemplate = externalAdditionalPanelButtons.template;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Output() onLeaveButtonClicked = new EventEmitter<any>();
|
/**
|
||||||
@Output() onCameraButtonClicked = new EventEmitter<any>();
|
* Provides event notifications that fire when leave button has been clicked.
|
||||||
@Output() onMicrophoneButtonClicked = new EventEmitter<any>();
|
*/
|
||||||
@Output() onFullscreenButtonClicked = new EventEmitter<any>();
|
@Output() onLeaveButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
||||||
@Output() onScreenshareButtonClicked = new EventEmitter<any>();
|
|
||||||
@Output() onParticipantsPanelButtonClicked = new EventEmitter<any>();
|
/**
|
||||||
@Output() onChatPanelButtonClicked = new EventEmitter<any>();
|
* Provides event notifications that fire when camera toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onCameraButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when microphone toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onMicrophoneButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when fullscreen toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onFullscreenButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when screenshare toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onScreenshareButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when participants panel button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onParticipantsPanelButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when chat panel button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onChatPanelButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ignore
|
* @ignore
|
||||||
|
|
|
@ -26,7 +26,7 @@ import {
|
||||||
ToolbarDirective
|
ToolbarDirective
|
||||||
} from '../../directives/template/openvidu-angular.directive';
|
} from '../../directives/template/openvidu-angular.directive';
|
||||||
import { ILogger } from '../../models/logger.model';
|
import { ILogger } from '../../models/logger.model';
|
||||||
import { ParticipantProperties } from '../../models/participant.model';
|
import { ParticipantAbstractModel, ParticipantProperties } from '../../models/participant.model';
|
||||||
import { TokenModel } from '../../models/token.model';
|
import { TokenModel } from '../../models/token.model';
|
||||||
import { ActionService } from '../../services/action/action.service';
|
import { ActionService } from '../../services/action/action.service';
|
||||||
import { OpenViduAngularConfigService } from '../../services/config/openvidu-angular.config.service';
|
import { OpenViduAngularConfigService } from '../../services/config/openvidu-angular.config.service';
|
||||||
|
@ -232,10 +232,6 @@ export class VideoconferenceComponent implements OnInit, OnDestroy, AfterViewIni
|
||||||
*/
|
*/
|
||||||
openviduAngularStreamTemplate: TemplateRef<any>;
|
openviduAngularStreamTemplate: TemplateRef<any>;
|
||||||
|
|
||||||
// *** Parameters ***
|
|
||||||
// @Input() sessionName: string;
|
|
||||||
// @Input() participantName: string;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {TokenModel} tokens The tokens parameter must be an object with `webcam` and `screen` fields.
|
* @param {TokenModel} tokens The tokens parameter must be an object with `webcam` and `screen` fields.
|
||||||
* Both of them are `string` type. See {@link TokenModel}
|
* Both of them are `string` type. See {@link TokenModel}
|
||||||
|
@ -255,26 +251,56 @@ export class VideoconferenceComponent implements OnInit, OnDestroy, AfterViewIni
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// *** Events ***
|
/**
|
||||||
|
* Provides event notifications that fire when join button (in prejoin page) has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onJoinButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
// Event sent when user click on the join button in pre-join page
|
/**
|
||||||
@Output() onJoinButtonClicked = new EventEmitter<any>();
|
* Provides event notifications that fire when leave button has been clicked.
|
||||||
// Event sent when user click on the join button in pre-join page
|
*/
|
||||||
@Output() onToolbarLeaveButtonClicked = new EventEmitter<any>();
|
@Output() onToolbarLeaveButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
@Output() onToolbarCameraButtonClicked = new EventEmitter<any>();
|
|
||||||
@Output() onToolbarMicrophoneButtonClicked = new EventEmitter<any>();
|
|
||||||
@Output() onToolbarScreenshareButtonClicked = new EventEmitter<any>();
|
|
||||||
@Output() onToolbarFullscreenButtonClicked = new EventEmitter<any>();
|
|
||||||
@Output() onToolbarParticipantsPanelButtonClicked = new EventEmitter<any>();
|
|
||||||
@Output() onToolbarChatPanelButtonClicked = new EventEmitter<any>();
|
|
||||||
|
|
||||||
// Event sent when participant has joined the session
|
/**
|
||||||
// @Output() onParticipantJoined = new EventEmitter<any>();
|
* Provides event notifications that fire when camera toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarCameraButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
// Event sent when session has been created
|
/**
|
||||||
@Output() onSessionCreated = new EventEmitter<any>();
|
* Provides event notifications that fire when microphone toolbar button has been clicked.
|
||||||
// Event sent when participant has been created
|
*/
|
||||||
@Output() onParticipantCreated = new EventEmitter<any>();
|
@Output() onToolbarMicrophoneButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when screenshare toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarScreenshareButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when fullscreen toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarFullscreenButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when participants panel button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarParticipantsPanelButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when chat panel button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarChatPanelButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when OpenVidu Session is created.
|
||||||
|
* See {@link https://docs.openvidu.io/en/stable/api/openvidu-browser/classes/Session.html openvidu-browser Session}.
|
||||||
|
*/
|
||||||
|
@Output() onSessionCreated: EventEmitter<Session> = new EventEmitter<Session>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when local participant is created.
|
||||||
|
*/
|
||||||
|
@Output() onParticipantCreated: EventEmitter<ParticipantAbstractModel> = new EventEmitter<ParticipantAbstractModel>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
@ -494,8 +520,8 @@ export class VideoconferenceComponent implements OnInit, OnDestroy, AfterViewIni
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
_onSessionCreated(event: Session) {
|
_onSessionCreated(session: Session) {
|
||||||
this.onSessionCreated.emit(event);
|
this.onSessionCreated.emit(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
private handlePublisherError(e: any) {
|
private handlePublisherError(e: any) {
|
||||||
|
|
|
@ -304,16 +304,56 @@ export class OpenviduWebComponentComponent implements OnInit {
|
||||||
this._participantPanelItemMuteButton = this.castToBoolean(value);
|
this._participantPanelItemMuteButton = this.castToBoolean(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Output() onJoinButtonClicked = new EventEmitter<any>();
|
/**
|
||||||
@Output() onToolbarLeaveButtonClicked = new EventEmitter<any>();
|
* Provides event notifications that fire when join button (in prejoin page) has been clicked.
|
||||||
@Output() onToolbarCameraButtonClicked = new EventEmitter<any>();
|
*/
|
||||||
@Output() onToolbarMicrophoneButtonClicked = new EventEmitter<any>();
|
@Output() onJoinButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
@Output() onToolbarScreenshareButtonClicked = new EventEmitter<any>();
|
|
||||||
@Output() onToolbarParticipantsPanelButtonClicked = new EventEmitter<any>();
|
/**
|
||||||
@Output() onToolbarChatPanelButtonClicked = new EventEmitter<any>();
|
* Provides event notifications that fire when leave button has been clicked.
|
||||||
@Output() onToolbarFullscreenButtonClicked = new EventEmitter<any>();
|
*/
|
||||||
@Output() onSessionCreated = new EventEmitter<any>();
|
@Output() onToolbarLeaveButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
@Output() onParticipantCreated = new EventEmitter<any>();
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when camera toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarCameraButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when microphone toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarMicrophoneButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when screenshare toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarScreenshareButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when fullscreen toolbar button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarFullscreenButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when participants panel button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarParticipantsPanelButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when chat panel button has been clicked.
|
||||||
|
*/
|
||||||
|
@Output() onToolbarChatPanelButtonClicked: EventEmitter<void> = new EventEmitter<void>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when OpenVidu Session is created.
|
||||||
|
* See {@link https://docs.openvidu.io/en/stable/api/openvidu-browser/classes/Session.html openvidu-browser Session}.
|
||||||
|
*/
|
||||||
|
@Output() onSessionCreated: EventEmitter<Session> = new EventEmitter<Session>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides event notifications that fire when local participant is created.
|
||||||
|
*/
|
||||||
|
@Output() onParticipantCreated: EventEmitter<ParticipantAbstractModel> = new EventEmitter<ParticipantAbstractModel>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
@ -405,15 +445,15 @@ export class OpenviduWebComponentComponent implements OnInit {
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
_onSessionCreated(event: Session) {
|
_onSessionCreated(session: Session) {
|
||||||
this.onSessionCreated.emit(event);
|
this.onSessionCreated.emit(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
_onParticipantCreated(event: ParticipantAbstractModel) {
|
_onParticipantCreated(participant: ParticipantAbstractModel) {
|
||||||
this.onParticipantCreated.emit(event);
|
this.onParticipantCreated.emit(participant);
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnect() {
|
disconnect() {
|
||||||
|
|
Loading…
Reference in New Issue