mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Fixed prejoin selectors when is iPhone
parent
1f348d2986
commit
f93b55818d
|
@ -3,8 +3,7 @@
|
||||||
<!-- <span>OpenVidu Call</span> -->
|
<!-- <span>OpenVidu Call</span> -->
|
||||||
<span class="spacer"></span>
|
<span class="spacer"></span>
|
||||||
|
|
||||||
<ov-lang-selector *ngIf="!isMinimal"></ov-lang-selector>
|
<ov-lang-selector *ngIf="!isMinimal" (onLangSelectorClicked)="onDeviceSelectorClicked()"></ov-lang-selector>
|
||||||
|
|
||||||
</mat-toolbar>
|
</mat-toolbar>
|
||||||
|
|
||||||
<div class="container" id="prejoin-container" fxLayout.gt-sm="row" fxLayout.lt-md="column">
|
<div class="container" id="prejoin-container" fxLayout.gt-sm="row" fxLayout.lt-md="column">
|
||||||
|
@ -51,11 +50,10 @@
|
||||||
<hr *ngIf="windowSize >= 960" />
|
<hr *ngIf="windowSize >= 960" />
|
||||||
|
|
||||||
<!-- Camera -->
|
<!-- Camera -->
|
||||||
<ov-video-devices-select></ov-video-devices-select>
|
<ov-video-devices-select (onDeviceSelectorClicked)="onDeviceSelectorClicked()"></ov-video-devices-select>
|
||||||
|
|
||||||
<!-- Microphone -->
|
<!-- Microphone -->
|
||||||
<ov-audio-devices-select></ov-audio-devices-select>
|
<ov-audio-devices-select (onDeviceSelectorClicked)="onDeviceSelectorClicked()"></ov-audio-devices-select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div fxFlex.gt-sm="60%" fxLayout.lt-md="column" fxLayoutAlign="center center" fxFlexFill class="join-btn-container">
|
<div fxFlex.gt-sm="60%" fxLayout.lt-md="column" fxLayoutAlign="center center" fxFlexFill class="join-btn-container">
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import { Component, HostListener, OnDestroy, OnInit, Output, EventEmitter, ViewChild, AfterViewInit } from '@angular/core';
|
import { Component, HostListener, OnDestroy, OnInit, Output, EventEmitter } from '@angular/core';
|
||||||
import { MatMenuTrigger } from '@angular/material/menu';
|
|
||||||
import { MatSelect } from '@angular/material/select';
|
|
||||||
|
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { CustomDevice } from '../../models/device.model';
|
import { CustomDevice } from '../../models/device.model';
|
||||||
|
@ -22,16 +20,7 @@ import { ParticipantService } from '../../services/participant/participant.servi
|
||||||
templateUrl: './pre-join.component.html',
|
templateUrl: './pre-join.component.html',
|
||||||
styleUrls: ['./pre-join.component.css']
|
styleUrls: ['./pre-join.component.css']
|
||||||
})
|
})
|
||||||
export class PreJoinComponent implements OnInit, OnDestroy, AfterViewInit {
|
export class PreJoinComponent implements OnInit, OnDestroy {
|
||||||
/**
|
|
||||||
* @ignore
|
|
||||||
*/
|
|
||||||
@ViewChild(MatMenuTrigger) public menuTrigger: MatMenuTrigger;
|
|
||||||
/**
|
|
||||||
* @ignore
|
|
||||||
*/
|
|
||||||
@ViewChild(MatSelect) matSelect: MatSelect;
|
|
||||||
|
|
||||||
@Output() onJoinButtonClicked = new EventEmitter<any>();
|
@Output() onJoinButtonClicked = new EventEmitter<any>();
|
||||||
cameras: CustomDevice[];
|
cameras: CustomDevice[];
|
||||||
microphones: CustomDevice[];
|
microphones: CustomDevice[];
|
||||||
|
@ -88,17 +77,6 @@ export class PreJoinComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
|
||||||
// Some devices as iPhone do not show the menu panels correctly
|
|
||||||
// Updating the container where the panel is added fix the problem.
|
|
||||||
this.menuTrigger?.menuOpened.subscribe(() => {
|
|
||||||
this.cdkSrv.setSelector('#prejoin-container');
|
|
||||||
});
|
|
||||||
this.matSelect?.openedChange.subscribe(() => {
|
|
||||||
this.cdkSrv.setSelector('#prejoin-container');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async ngOnDestroy() {
|
async ngOnDestroy() {
|
||||||
this.cdkSrv.setSelector('body');
|
this.cdkSrv.setSelector('body');
|
||||||
if (this.localParticipantSubscription) this.localParticipantSubscription.unsubscribe();
|
if (this.localParticipantSubscription) this.localParticipantSubscription.unsubscribe();
|
||||||
|
@ -108,6 +86,12 @@ export class PreJoinComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
this.panelService.closePanel();
|
this.panelService.closePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onDeviceSelectorClicked() {
|
||||||
|
// Some devices as iPhone do not show the menu panels correctly
|
||||||
|
// Updating the container where the panel is added fix the problem.
|
||||||
|
this.cdkSrv.setSelector('#prejoin-container');
|
||||||
|
}
|
||||||
|
|
||||||
joinSession() {
|
joinSession() {
|
||||||
this.onJoinButtonClicked.emit();
|
this.onJoinButtonClicked.emit();
|
||||||
this.panelService.closePanel();
|
this.panelService.closePanel();
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<mat-select
|
<mat-select
|
||||||
[disabled]="isAudioMuted || !hasAudioDevices"
|
[disabled]="isAudioMuted || !hasAudioDevices"
|
||||||
[value]="microphoneSelected?.device"
|
[value]="microphoneSelected?.device"
|
||||||
|
(click)="onDeviceSelectorClicked.emit()"
|
||||||
(selectionChange)="onMicrophoneSelected($event)"
|
(selectionChange)="onMicrophoneSelected($event)"
|
||||||
>
|
>
|
||||||
<mat-option *ngFor="let microphone of microphones" [value]="microphone.device">
|
<mat-option *ngFor="let microphone of microphones" [value]="microphone.device">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { EventEmitter, Component, OnDestroy, OnInit, Output } from '@angular/core';
|
||||||
import { PublisherProperties } from 'openvidu-browser';
|
import { PublisherProperties } from 'openvidu-browser';
|
||||||
import { DeviceService } from '../../../services/device/device.service';
|
import { DeviceService } from '../../../services/device/device.service';
|
||||||
import { OpenViduService } from '../../../services/openvidu/openvidu.service';
|
import { OpenViduService } from '../../../services/openvidu/openvidu.service';
|
||||||
|
@ -18,6 +18,7 @@ import { VideoType } from '../../../models/video-type.model';
|
||||||
styleUrls: ['./audio-devices.component.css']
|
styleUrls: ['./audio-devices.component.css']
|
||||||
})
|
})
|
||||||
export class AudioDevicesComponent implements OnInit, OnDestroy {
|
export class AudioDevicesComponent implements OnInit, OnDestroy {
|
||||||
|
@Output() onDeviceSelectorClicked = new EventEmitter<void>();
|
||||||
hasAudioDevices: boolean;
|
hasAudioDevices: boolean;
|
||||||
isAudioMuted: boolean;
|
isAudioMuted: boolean;
|
||||||
microphoneSelected: CustomDevice;
|
microphoneSelected: CustomDevice;
|
||||||
|
@ -28,7 +29,7 @@ export class AudioDevicesComponent implements OnInit, OnDestroy {
|
||||||
private openviduService: OpenViduService,
|
private openviduService: OpenViduService,
|
||||||
private deviceSrv: DeviceService,
|
private deviceSrv: DeviceService,
|
||||||
private storageSrv: StorageService,
|
private storageSrv: StorageService,
|
||||||
protected participantService: ParticipantService
|
private participantService: ParticipantService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|
|
@ -1,16 +1,32 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { AfterViewInit, Component, OnInit, Output, ViewChild,EventEmitter } from '@angular/core';
|
||||||
|
import { MatMenuTrigger } from '@angular/material/menu';
|
||||||
|
import { MatSelect } from '@angular/material/select';
|
||||||
import { StorageService } from '../../../services/storage/storage.service';
|
import { StorageService } from '../../../services/storage/storage.service';
|
||||||
import { TranslateService } from '../../../services/translate/translate.service';
|
import { TranslateService } from '../../../services/translate/translate.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ov-lang-selector',
|
selector: 'ov-lang-selector',
|
||||||
templateUrl: './lang-selector.component.html',
|
templateUrl: './lang-selector.component.html',
|
||||||
styleUrls: ['./lang-selector.component.css']
|
styleUrls: ['./lang-selector.component.css']
|
||||||
})
|
})
|
||||||
export class LangSelectorComponent implements OnInit {
|
export class LangSelectorComponent implements OnInit, AfterViewInit {
|
||||||
|
@Output() onLangSelectorClicked = new EventEmitter<void>();
|
||||||
langSelected: { name: string; ISO: string };
|
langSelected: { name: string; ISO: string };
|
||||||
languages: { name: string; ISO: string }[] = [];
|
languages: { name: string; ISO: string }[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
|
@ViewChild(MatMenuTrigger) public menuTrigger: MatMenuTrigger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
|
@ViewChild(MatSelect) matSelect: MatSelect;
|
||||||
|
|
||||||
constructor(private translateService: TranslateService, private storageSrv: StorageService) {}
|
constructor(private translateService: TranslateService, private storageSrv: StorageService) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
@ -18,6 +34,15 @@ export class LangSelectorComponent implements OnInit {
|
||||||
this.langSelected = this.translateService.getLangSelected();
|
this.langSelected = this.translateService.getLangSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
this.menuTrigger?.menuOpened.subscribe(() => {
|
||||||
|
this.onLangSelectorClicked.emit();
|
||||||
|
});
|
||||||
|
this.matSelect?.openedChange.subscribe(() => {
|
||||||
|
this.onLangSelectorClicked.emit();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onLangSelected(lang: string) {
|
onLangSelected(lang: string) {
|
||||||
this.translateService.setLanguage(lang);
|
this.translateService.setLanguage(lang);
|
||||||
this.storageSrv.setLang(lang);
|
this.storageSrv.setLang(lang);
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<mat-select
|
<mat-select
|
||||||
[disabled]="isVideoMuted || !hasVideoDevices"
|
[disabled]="isVideoMuted || !hasVideoDevices"
|
||||||
[value]="cameraSelected?.device"
|
[value]="cameraSelected?.device"
|
||||||
|
(click)="onDeviceSelectorClicked.emit()"
|
||||||
(selectionChange)="onCameraSelected($event)"
|
(selectionChange)="onCameraSelected($event)"
|
||||||
>
|
>
|
||||||
<mat-option *ngFor="let camera of cameras" [value]="camera.device">
|
<mat-option *ngFor="let camera of cameras" [value]="camera.device">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
import { Component, OnInit, OnDestroy, Output, EventEmitter } from '@angular/core';
|
||||||
import { PublisherProperties } from 'openvidu-browser';
|
import { PublisherProperties } from 'openvidu-browser';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { CustomDevice } from '../../../models/device.model';
|
import { CustomDevice } from '../../../models/device.model';
|
||||||
|
@ -21,6 +21,8 @@ import { VirtualBackgroundService } from '../../../services/virtual-background/v
|
||||||
styleUrls: ['./video-devices.component.css']
|
styleUrls: ['./video-devices.component.css']
|
||||||
})
|
})
|
||||||
export class VideoDevicesComponent implements OnInit, OnDestroy {
|
export class VideoDevicesComponent implements OnInit, OnDestroy {
|
||||||
|
@Output() onDeviceSelectorClicked = new EventEmitter<void>();
|
||||||
|
|
||||||
videoMuteChanging: boolean;
|
videoMuteChanging: boolean;
|
||||||
isVideoMuted: boolean;
|
isVideoMuted: boolean;
|
||||||
cameraSelected: CustomDevice;
|
cameraSelected: CustomDevice;
|
||||||
|
|
Loading…
Reference in New Issue