mirror of https://github.com/OpenVidu/openvidu.git
Send message feature
parent
acc4d78788
commit
06a2725da8
|
@ -27,7 +27,7 @@
|
||||||
"colormap": "^2.2.0",
|
"colormap": "^2.2.0",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"openvidu-browser": "1.1.1",
|
"openvidu-browser": "1.2.0",
|
||||||
"openvidu-node-client": "1.1.0",
|
"openvidu-node-client": "1.1.0",
|
||||||
"rxjs": "^5.4.2",
|
"rxjs": "^5.4.2",
|
||||||
"zone.js": "^0.8.14"
|
"zone.js": "^0.8.14"
|
||||||
|
|
|
@ -85,6 +85,9 @@
|
||||||
<div class="session-card-inner">
|
<div class="session-card-inner">
|
||||||
<div class="session-title">{{sessionName}}</div>
|
<div class="session-title">{{sessionName}}</div>
|
||||||
<div class="session-actions">
|
<div class="session-actions">
|
||||||
|
<button class="message-btn" (click)="sendMessage()">
|
||||||
|
<mat-icon aria-label="Send message button">chat</mat-icon>
|
||||||
|
</button>
|
||||||
<button class="video-btn" *ngIf="publishTo && sendVideo" (click)="toggleVideo()">
|
<button class="video-btn" *ngIf="publishTo && sendVideo" (click)="toggleVideo()">
|
||||||
<mat-icon aria-label="Mute video button">{{videoIcon}}</mat-icon>
|
<mat-icon aria-label="Mute video button">{{videoIcon}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {
|
||||||
Component, Input, HostListener, ChangeDetectorRef, SimpleChanges, ElementRef, ViewChild,
|
Component, Input, HostListener, ChangeDetectorRef, SimpleChanges, ElementRef, ViewChild,
|
||||||
OnInit, OnDestroy, OnChanges
|
OnInit, OnDestroy, OnChanges
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { OpenVidu, Session, Subscriber, Publisher, Stream } from 'openvidu-browser';
|
import { OpenVidu, Session, Subscriber, Publisher, Stream, Connection } from 'openvidu-browser';
|
||||||
import { MatDialog } from '@angular/material';
|
import { MatDialog } from '@angular/material';
|
||||||
import { ExtensionDialogComponent } from './extension-dialog.component';
|
import { ExtensionDialogComponent } from './extension-dialog.component';
|
||||||
import { TestFeedService } from '../../services/test-feed.service';
|
import { TestFeedService } from '../../services/test-feed.service';
|
||||||
|
@ -187,7 +187,6 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
this.removeUserData(event.stream.connection);
|
this.removeUserData(event.stream.connection);
|
||||||
this.updateEventList('streamDestroyed', event.stream.connection.connectionId);
|
this.updateEventList('streamDestroyed', event.stream.connection.connectionId);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.session.on('connectionCreated', (event) => {
|
this.session.on('connectionCreated', (event) => {
|
||||||
this.updateEventList('connectionCreated', event.connection.connectionId);
|
this.updateEventList('connectionCreated', event.connection.connectionId);
|
||||||
});
|
});
|
||||||
|
@ -197,6 +196,9 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
this.session.on('sessionDisconnected', (event) => {
|
this.session.on('sessionDisconnected', (event) => {
|
||||||
this.updateEventList('sessionDisconnected', 'No data');
|
this.updateEventList('sessionDisconnected', 'No data');
|
||||||
});
|
});
|
||||||
|
this.session.on('signal', (event) => {
|
||||||
|
this.updateEventList('signal', event.from.connectionId + '-' + event.data);
|
||||||
|
});
|
||||||
|
|
||||||
this.session.connect(token, this.clientData, (error) => {
|
this.session.connect(token, this.clientData, (error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
@ -398,4 +400,12 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
this.activeVideo = !this.activeVideo;
|
this.activeVideo = !this.activeVideo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendMessage(): void {
|
||||||
|
this.session.signal({
|
||||||
|
data: 'Test message',
|
||||||
|
to: [],
|
||||||
|
type: 'chat'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue