Angular ts files beautified and formatted
This commit is contained in:
parent
26185f8416
commit
b8784fca67
@ -1,28 +1,26 @@
|
||||
.demo-logo{
|
||||
.demo-logo {
|
||||
height: 26px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#img-div{
|
||||
#img-div {
|
||||
max-width: 60%;
|
||||
margin: 10px auto;
|
||||
|
||||
}
|
||||
|
||||
#title{
|
||||
#title {
|
||||
margin-bottom: 10px;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
#join-button{
|
||||
#join-button {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
#session-header{
|
||||
#session-header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
ion-col{
|
||||
ion-col {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,12 +1,11 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { TestBed, async } from '@angular/core/testing';
|
||||
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
||||
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
||||
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
|
||||
describe('AppComponent', () => {
|
||||
|
||||
let statusBarSpy, splashScreenSpy, platformReadySpy, platformSpy;
|
||||
|
||||
@ -1,15 +1,13 @@
|
||||
import { Component, OnDestroy, Input, HostListener } from '@angular/core';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Component, HostListener, OnDestroy } from '@angular/core';
|
||||
import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
|
||||
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
||||
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
||||
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { OpenVidu, Publisher, Session, StreamEvent, StreamManager, Subscriber } from 'openvidu-browser';
|
||||
import { throwError as observableThrowError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { OpenVidu, Session, StreamManager, Publisher, Subscriber, StreamEvent } from 'openvidu-browser';
|
||||
|
||||
import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@ -17,6 +15,7 @@ import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
|
||||
styleUrls: ['app.component.css'],
|
||||
})
|
||||
export class AppComponent implements OnDestroy {
|
||||
|
||||
OPENVIDU_SERVER_URL = 'https://' + location.hostname + ':4443';
|
||||
OPENVIDU_SERVER_SECRET = 'MY_SECRET';
|
||||
|
||||
@ -188,15 +187,15 @@ export class AppComponent implements OnDestroy {
|
||||
reject(
|
||||
new Error(
|
||||
'Permissions denied: ' +
|
||||
'\n' +
|
||||
' CAMERA = ' +
|
||||
camera.hasPermission +
|
||||
'\n' +
|
||||
' AUDIO = ' +
|
||||
audio.hasPermission +
|
||||
'\n' +
|
||||
' AUDIO_SETTINGS = ' +
|
||||
modifyAudio.hasPermission,
|
||||
'\n' +
|
||||
' CAMERA = ' +
|
||||
camera.hasPermission +
|
||||
'\n' +
|
||||
' AUDIO = ' +
|
||||
audio.hasPermission +
|
||||
'\n' +
|
||||
' AUDIO_SETTINGS = ' +
|
||||
modifyAudio.hasPermission,
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -204,8 +203,8 @@ export class AppComponent implements OnDestroy {
|
||||
.catch((err) => {
|
||||
console.error(
|
||||
'Checking permission ' +
|
||||
this.androidPermissions.PERMISSION.MODIFY_AUDIO_SETTINGS +
|
||||
' failed',
|
||||
this.androidPermissions.PERMISSION.MODIFY_AUDIO_SETTINGS +
|
||||
' failed',
|
||||
);
|
||||
reject(err);
|
||||
});
|
||||
@ -276,17 +275,17 @@ export class AppComponent implements OnDestroy {
|
||||
} else {
|
||||
console.warn(
|
||||
'No connection to OpenVidu Server. This may be a certificate error at ' +
|
||||
this.OPENVIDU_SERVER_URL,
|
||||
this.OPENVIDU_SERVER_URL,
|
||||
);
|
||||
if (
|
||||
window.confirm(
|
||||
'No connection to OpenVidu Server. This may be a certificate error at "' +
|
||||
this.OPENVIDU_SERVER_URL +
|
||||
// tslint:disable-next-line:max-line-length
|
||||
'"\n\nClick OK to navigate and accept it. If no certificate warning is shown, then check that your OpenVidu Server' +
|
||||
'is up and running at "' +
|
||||
this.OPENVIDU_SERVER_URL +
|
||||
'"',
|
||||
this.OPENVIDU_SERVER_URL +
|
||||
// tslint:disable-next-line:max-line-length
|
||||
'"\n\nClick OK to navigate and accept it. If no certificate warning is shown, then check that your OpenVidu Server' +
|
||||
'is up and running at "' +
|
||||
this.OPENVIDU_SERVER_URL +
|
||||
'"',
|
||||
)
|
||||
) {
|
||||
location.assign(this.OPENVIDU_SERVER_URL + '/accept-certificate');
|
||||
|
||||
@ -1,18 +1,16 @@
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { RouterModule, RouteReuseStrategy, Routes } from '@angular/router';
|
||||
|
||||
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||
import { RouteReuseStrategy } from '@angular/router';
|
||||
import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
|
||||
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
||||
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
||||
|
||||
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||
import { AppComponent } from './app.component';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { UserVideoComponent } from './user-video.component';
|
||||
import { OpenViduVideoComponent } from './ov-video.component';
|
||||
import { UserVideoComponent } from './user-video.component';
|
||||
|
||||
import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent, UserVideoComponent, OpenViduVideoComponent],
|
||||
@ -26,4 +24,4 @@ import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule {}
|
||||
export class AppModule { }
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Component, Input, ViewChild, ElementRef, AfterViewInit } from '@angular/core';
|
||||
import { AfterViewInit, Component, ElementRef, Input, ViewChild } from '@angular/core';
|
||||
import { StreamManager } from 'openvidu-browser';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'ov-video',
|
||||
template: '<video #videoElement></video>',
|
||||
@ -13,9 +14,8 @@ import { StreamManager } from 'openvidu-browser';
|
||||
],
|
||||
})
|
||||
export class OpenViduVideoComponent implements AfterViewInit {
|
||||
@ViewChild('videoElement')
|
||||
elementRef: ElementRef;
|
||||
|
||||
@ViewChild('videoElement') elementRef: ElementRef;
|
||||
_streamManager: StreamManager;
|
||||
|
||||
ngAfterViewInit() {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { StreamManager } from 'openvidu-browser';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'user-video',
|
||||
styles: [
|
||||
@ -32,15 +33,15 @@ import { StreamManager } from 'openvidu-browser';
|
||||
</div>`,
|
||||
})
|
||||
export class UserVideoComponent {
|
||||
|
||||
@Input()
|
||||
streamManager: StreamManager;
|
||||
|
||||
getNicknameTag() {
|
||||
// Gets the nickName of the user
|
||||
try {
|
||||
return JSON.parse(this.streamManager.stream.connection.data).clientData;
|
||||
} catch (err) {
|
||||
console.error('ClientData does not exist');
|
||||
console.error('ClientData is not JSON formatted');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { environment } from './environments/environment';
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user