├── .gitignore ├── README.md ├── angular.json ├── browserslist ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.json ├── ionic.config.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── src ├── app │ ├── app-routing.module.ts │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── home │ │ ├── home.module.ts │ │ ├── home.page.html │ │ ├── home.page.scss │ │ ├── home.page.spec.ts │ │ └── home.page.ts │ └── providers │ │ ├── webrtc.service.spec.ts │ │ └── webrtc.service.ts ├── assets │ ├── icon │ │ └── favicon.png │ └── shapes.svg ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── global.scss ├── index.html ├── main.ts ├── polyfills.ts ├── test.ts ├── theme │ └── variables.scss └── zone-flags.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json ├── tslint.json └── typings └── cordova-typings.d.ts /.gitignore: -------------------------------------------------------------------------------- 1 | # Specifies intentionally untracked files to ignore when using Git 2 | # http://git-scm.com/docs/gitignore 3 | 4 | *~ 5 | *.sw[mnpcod] 6 | .tmp 7 | *.tmp 8 | *.tmp.* 9 | *.sublime-project 10 | *.sublime-workspace 11 | .DS_Store 12 | Thumbs.db 13 | UserInterfaceState.xcuserstate 14 | $RECYCLE.BIN/ 15 | 16 | *.log 17 | log.txt 18 | npm-debug.log* 19 | 20 | /.idea 21 | /.ionic 22 | /.sass-cache 23 | /.sourcemaps 24 | /.versions 25 | /.vscode 26 | /coverage 27 | /dist 28 | /node_modules 29 | /platforms 30 | /plugins 31 | /www 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ionic-video-call 2 | A simple video call with ionic5 angular 9 and peerjs. 3 | 4 | more description on: https://dev.to/timsar2/ionic-video-call-by-peerjs-4fli 5 | 6 | how to run: 7 | 8 | connect your pc/laptop to a network, also your second device (pc/laptop/mobile) must be in same netwrok. 9 | 10 | find your ip address, you can run ipconfig /all or look at your netwrok card detail. 11 | 12 | it must be somthing like 192.168.43.105 13 | Or open two tab in the same browser(two tab in chrome or two tab in firefox...) 14 | 15 | from your console, inside of project folder run this commands: 16 | 17 | 1- npm install 18 | 19 | then run ionic with your ip address and ssl parameter. 20 | 21 | 2- ionic serve --adress 192.168.43.105 --ssl 22 | 23 | visit url with https prefix 24 | 25 | 3- https://192.168.43.105:8100 26 | 27 | if you can't see url, check your firewall or antivirus. 28 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "defaultProject": "app", 5 | "newProjectRoot": "projects", 6 | "projects": { 7 | "app": { 8 | "root": "", 9 | "sourceRoot": "src", 10 | "projectType": "application", 11 | "prefix": "app", 12 | "schematics": {}, 13 | "architect": { 14 | "build": { 15 | "builder": "@angular-devkit/build-angular:browser", 16 | "options": { 17 | "aot": true, 18 | "outputPath": "www", 19 | "index": "src/index.html", 20 | "main": "src/main.ts", 21 | "polyfills": "src/polyfills.ts", 22 | "tsConfig": "tsconfig.app.json", 23 | "assets": [ 24 | { 25 | "glob": "**/*", 26 | "input": "src/assets", 27 | "output": "assets" 28 | }, 29 | { 30 | "glob": "**/*.svg", 31 | "input": "node_modules/ionicons/dist/ionicons/svg", 32 | "output": "./svg" 33 | } 34 | ], 35 | "styles": [ 36 | { 37 | "input": "src/theme/variables.scss" 38 | }, 39 | { 40 | "input": "src/global.scss" 41 | } 42 | ], 43 | "scripts": [] 44 | }, 45 | "configurations": { 46 | "production": { 47 | "fileReplacements": [ 48 | { 49 | "replace": "src/environments/environment.ts", 50 | "with": "src/environments/environment.prod.ts" 51 | } 52 | ], 53 | "optimization": true, 54 | "outputHashing": "all", 55 | "sourceMap": false, 56 | "extractCss": true, 57 | "namedChunks": false, 58 | "aot": true, 59 | "extractLicenses": true, 60 | "vendorChunk": false, 61 | "buildOptimizer": true, 62 | "budgets": [ 63 | { 64 | "type": "initial", 65 | "maximumWarning": "2mb", 66 | "maximumError": "5mb" 67 | }, 68 | { 69 | "type": "anyComponentStyle", 70 | "maximumWarning": "6kb" 71 | } 72 | ] 73 | }, 74 | "ci": { 75 | "budgets": [ 76 | { 77 | "type": "anyComponentStyle", 78 | "maximumWarning": "6kb" 79 | } 80 | ], 81 | "progress": false 82 | } 83 | } 84 | }, 85 | "serve": { 86 | "builder": "@angular-devkit/build-angular:dev-server", 87 | "options": { 88 | "browserTarget": "app:build" 89 | }, 90 | "configurations": { 91 | "production": { 92 | "browserTarget": "app:build:production" 93 | }, 94 | "ci": { 95 | "progress": false 96 | } 97 | } 98 | }, 99 | "extract-i18n": { 100 | "builder": "@angular-devkit/build-angular:extract-i18n", 101 | "options": { 102 | "browserTarget": "app:build" 103 | } 104 | }, 105 | "test": { 106 | "builder": "@angular-devkit/build-angular:karma", 107 | "options": { 108 | "main": "src/test.ts", 109 | "polyfills": "src/polyfills.ts", 110 | "tsConfig": "tsconfig.spec.json", 111 | "karmaConfig": "karma.conf.js", 112 | "styles": [], 113 | "scripts": [], 114 | "assets": [ 115 | { 116 | "glob": "favicon.ico", 117 | "input": "src/", 118 | "output": "/" 119 | }, 120 | { 121 | "glob": "**/*", 122 | "input": "src/assets", 123 | "output": "/assets" 124 | } 125 | ] 126 | }, 127 | "configurations": { 128 | "ci": { 129 | "progress": false, 130 | "watch": false 131 | } 132 | } 133 | }, 134 | "lint": { 135 | "builder": "@angular-devkit/build-angular:tslint", 136 | "options": { 137 | "tsConfig": [ 138 | "tsconfig.app.json", 139 | "tsconfig.spec.json", 140 | "e2e/tsconfig.json" 141 | ], 142 | "exclude": [ 143 | "**/node_modules/**" 144 | ] 145 | } 146 | }, 147 | "e2e": { 148 | "builder": "@angular-devkit/build-angular:protractor", 149 | "options": { 150 | "protractorConfig": "e2e/protractor.conf.js", 151 | "devServerTarget": "app:serve" 152 | }, 153 | "configurations": { 154 | "production": { 155 | "devServerTarget": "app:serve:production" 156 | }, 157 | "ci": { 158 | "devServerTarget": "app:serve:ci" 159 | } 160 | } 161 | }, 162 | "ionic-cordova-build": { 163 | "builder": "@ionic/angular-toolkit:cordova-build", 164 | "options": { 165 | "browserTarget": "app:build" 166 | }, 167 | "configurations": { 168 | "production": { 169 | "browserTarget": "app:build:production" 170 | } 171 | } 172 | }, 173 | "ionic-cordova-serve": { 174 | "builder": "@ionic/angular-toolkit:cordova-serve", 175 | "options": { 176 | "cordovaBuildTarget": "app:ionic-cordova-build", 177 | "devServerTarget": "app:serve" 178 | }, 179 | "configurations": { 180 | "production": { 181 | "cordovaBuildTarget": "app:ionic-cordova-build:production", 182 | "devServerTarget": "app:serve:production" 183 | } 184 | } 185 | } 186 | } 187 | } 188 | }, 189 | "cli": { 190 | "defaultCollection": "@ionic/angular-toolkit", 191 | "analytics": false 192 | }, 193 | "schematics": { 194 | "@ionic/angular-toolkit:component": { 195 | "styleext": "scss" 196 | }, 197 | "@ionic/angular-toolkit:page": { 198 | "styleext": "scss" 199 | } 200 | } 201 | } -------------------------------------------------------------------------------- /browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. 13 | -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('new App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should be blank', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toContain('Start with Ionic UI Components'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.deepCss('app-root ion-content')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-peer", 3 | "integrations": {}, 4 | "type": "angular" 5 | } 6 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-peer", 3 | "version": "0.0.1", 4 | "author": "Ionic Framework", 5 | "homepage": "https://ionicframework.com/", 6 | "scripts": { 7 | "ng": "ng", 8 | "start": "ng serve", 9 | "build": "ng build", 10 | "test": "ng test", 11 | "lint": "ng lint", 12 | "e2e": "ng e2e" 13 | }, 14 | "private": true, 15 | "dependencies": { 16 | "@angular/common": "~9.0.0", 17 | "@angular/core": "~9.0.0", 18 | "@angular/forms": "~9.0.0", 19 | "@angular/platform-browser": "~9.0.0", 20 | "@angular/platform-browser-dynamic": "~9.0.0", 21 | "@angular/router": "~9.0.0", 22 | "@ionic-native/core": "^5.0.0", 23 | "@ionic-native/splash-screen": "^5.0.0", 24 | "@ionic-native/status-bar": "^5.0.0", 25 | "@ionic/angular": "^5.0.0", 26 | "core-js": "^2.5.4", 27 | "peerjs": "^1.2.0", 28 | "rxjs": "~6.5.1", 29 | "tslib": "^1.10.0", 30 | "zone.js": "~0.10.2" 31 | }, 32 | "devDependencies": { 33 | "@angular-devkit/build-angular": "~0.900.1", 34 | "@angular/cli": "~9.0.1", 35 | "@angular/compiler": "~9.0.0", 36 | "@angular/compiler-cli": "~9.0.0", 37 | "@angular/language-service": "~9.0.0", 38 | "@ionic/angular-toolkit": "^2.1.1", 39 | "@types/jasmine": "~3.3.8", 40 | "@types/jasminewd2": "~2.0.3", 41 | "@types/node": "^12.11.1", 42 | "codelyzer": "^5.1.2", 43 | "jasmine-core": "~3.4.0", 44 | "jasmine-spec-reporter": "~4.2.1", 45 | "karma": "~6.3.14", 46 | "karma-chrome-launcher": "~2.2.0", 47 | "karma-coverage-istanbul-reporter": "~2.0.1", 48 | "karma-jasmine": "~2.0.1", 49 | "karma-jasmine-html-reporter": "^1.4.0", 50 | "protractor": "~5.4.0", 51 | "ts-node": "~7.0.0", 52 | "tslint": "~5.15.0", 53 | "typescript": "~3.7.5" 54 | }, 55 | "description": "An Ionic project" 56 | } 57 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; 3 | 4 | const routes: Routes = [ 5 | { path: '', redirectTo: 'home', pathMatch: 'full' }, 6 | { path: 'home', loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)}, 7 | ]; 8 | 9 | @NgModule({ 10 | imports: [ 11 | RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) 12 | ], 13 | exports: [RouterModule] 14 | }) 15 | export class AppRoutingModule { } 16 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timsar2/ionic-video-call/50435dc4f969e533785688e61e8c9c2e29e31471/src/app/app.component.scss -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { TestBed, async } from '@angular/core/testing'; 3 | 4 | import { Platform } from '@ionic/angular'; 5 | import { SplashScreen } from '@ionic-native/splash-screen/ngx'; 6 | import { StatusBar } from '@ionic-native/status-bar/ngx'; 7 | 8 | import { AppComponent } from './app.component'; 9 | 10 | describe('AppComponent', () => { 11 | 12 | let statusBarSpy, splashScreenSpy, platformReadySpy, platformSpy; 13 | 14 | beforeEach(async(() => { 15 | statusBarSpy = jasmine.createSpyObj('StatusBar', ['styleDefault']); 16 | splashScreenSpy = jasmine.createSpyObj('SplashScreen', ['hide']); 17 | platformReadySpy = Promise.resolve(); 18 | platformSpy = jasmine.createSpyObj('Platform', { ready: platformReadySpy }); 19 | 20 | TestBed.configureTestingModule({ 21 | declarations: [AppComponent], 22 | schemas: [CUSTOM_ELEMENTS_SCHEMA], 23 | providers: [ 24 | { provide: StatusBar, useValue: statusBarSpy }, 25 | { provide: SplashScreen, useValue: splashScreenSpy }, 26 | { provide: Platform, useValue: platformSpy }, 27 | ], 28 | }).compileComponents(); 29 | })); 30 | 31 | it('should create the app', () => { 32 | const fixture = TestBed.createComponent(AppComponent); 33 | const app = fixture.debugElement.componentInstance; 34 | expect(app).toBeTruthy(); 35 | }); 36 | 37 | it('should initialize the app', async () => { 38 | TestBed.createComponent(AppComponent); 39 | expect(platformSpy.ready).toHaveBeenCalled(); 40 | await platformReadySpy; 41 | expect(statusBarSpy.styleDefault).toHaveBeenCalled(); 42 | expect(splashScreenSpy.hide).toHaveBeenCalled(); 43 | }); 44 | 45 | // TODO: add more tests! 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { Platform } from '@ionic/angular'; 4 | import { SplashScreen } from '@ionic-native/splash-screen/ngx'; 5 | import { StatusBar } from '@ionic-native/status-bar/ngx'; 6 | 7 | @Component({ 8 | selector: 'app-root', 9 | templateUrl: 'app.component.html', 10 | styleUrls: ['app.component.scss'] 11 | }) 12 | export class AppComponent { 13 | constructor( 14 | private platform: Platform, 15 | private splashScreen: SplashScreen, 16 | private statusBar: StatusBar 17 | ) { 18 | this.initializeApp(); 19 | } 20 | 21 | initializeApp() { 22 | this.platform.ready().then(() => { 23 | this.statusBar.styleDefault(); 24 | this.splashScreen.hide(); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { RouteReuseStrategy } from '@angular/router'; 4 | 5 | import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; 6 | import { SplashScreen } from '@ionic-native/splash-screen/ngx'; 7 | import { StatusBar } from '@ionic-native/status-bar/ngx'; 8 | 9 | import { AppComponent } from './app.component'; 10 | import { AppRoutingModule } from './app-routing.module'; 11 | 12 | @NgModule({ 13 | declarations: [AppComponent], 14 | entryComponents: [], 15 | imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule], 16 | providers: [ 17 | StatusBar, 18 | SplashScreen, 19 | { provide: RouteReuseStrategy, useClass: IonicRouteStrategy } 20 | ], 21 | bootstrap: [AppComponent] 22 | }) 23 | export class AppModule {} 24 | -------------------------------------------------------------------------------- /src/app/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { IonicModule } from '@ionic/angular'; 4 | import { FormsModule } from '@angular/forms'; 5 | import { RouterModule } from '@angular/router'; 6 | 7 | import { HomePage } from './home.page'; 8 | 9 | @NgModule({ 10 | imports: [ 11 | CommonModule, 12 | FormsModule, 13 | IonicModule, 14 | RouterModule.forChild([ 15 | { 16 | path: '', 17 | component: HomePage 18 | } 19 | ]) 20 | ], 21 | declarations: [HomePage] 22 | }) 23 | export class HomePageModule {} 24 | -------------------------------------------------------------------------------- /src/app/home/home.page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Ionic Video Chat 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 15 | 18 | 19 | 20 | 21 | Login As: 22 | 23 | 24 | 25 | 26 | 27 | 28 | Call To: 29 | 30 | 31 | 32 | 33 |
34 | -------------------------------------------------------------------------------- /src/app/home/home.page.scss: -------------------------------------------------------------------------------- 1 | 2 | .top-video{ 3 | position: absolute; 4 | top: 100px; 5 | right: 100px; 6 | max-width: 100px; 7 | z-index: 2; 8 | } 9 | 10 | .main-video{ 11 | width: 100%; 12 | max-height: 70%; 13 | } -------------------------------------------------------------------------------- /src/app/home/home.page.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | import { IonicModule } from '@ionic/angular'; 3 | 4 | import { HomePage } from './home.page'; 5 | 6 | describe('HomePage', () => { 7 | let component: HomePage; 8 | let fixture: ComponentFixture; 9 | 10 | beforeEach(async(() => { 11 | TestBed.configureTestingModule({ 12 | declarations: [ HomePage ], 13 | imports: [IonicModule.forRoot()] 14 | }).compileComponents(); 15 | 16 | fixture = TestBed.createComponent(HomePage); 17 | component = fixture.componentInstance; 18 | fixture.detectChanges(); 19 | })); 20 | 21 | it('should create', () => { 22 | expect(component).toBeTruthy(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /src/app/home/home.page.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ElementRef } from '@angular/core'; 2 | import { WebrtcService } from '../providers/webrtc.service'; 3 | 4 | @Component({ 5 | selector: 'app-home', 6 | templateUrl: 'home.page.html', 7 | styleUrls: ['home.page.scss'], 8 | }) 9 | export class HomePage implements OnInit { 10 | topVideoFrame = 'partner-video'; 11 | userId: string; 12 | partnerId: string; 13 | myEl: HTMLMediaElement; 14 | partnerEl: HTMLMediaElement; 15 | 16 | constructor( 17 | public webRTC: WebrtcService, 18 | public elRef: ElementRef 19 | ) {} 20 | 21 | ngOnInit(): void { 22 | this.myEl = this.elRef.nativeElement.querySelector('#my-video'); 23 | this.partnerEl = this.elRef.nativeElement.querySelector('#partner-video'); 24 | } 25 | 26 | login() { 27 | this.webRTC.init(this.userId, this.myEl, this.partnerEl); 28 | } 29 | 30 | call() { 31 | this.webRTC.call(this.partnerId); 32 | this.swapVideo('my-video'); 33 | } 34 | 35 | swapVideo(topVideo: string) { 36 | this.topVideoFrame = topVideo; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/app/providers/webrtc.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { WebrtcService } from './webrtc.service'; 4 | 5 | describe('WebrtcService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: WebrtcService = TestBed.get(WebrtcService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /src/app/providers/webrtc.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import Peer from 'peerjs'; 3 | 4 | const constraints: MediaStreamConstraints = {video: true, audio: false}; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class WebrtcService { 10 | peer: Peer; 11 | myStream: MediaStream; 12 | myEl: HTMLMediaElement; 13 | partnerEl: HTMLMediaElement; 14 | 15 | stun = 'stun.l.google.com:19302'; 16 | mediaConnection: Peer.MediaConnection; 17 | options: Peer.PeerJSOption; 18 | stunServer: RTCIceServer = { 19 | urls: 'stun:' + this.stun, 20 | }; 21 | 22 | constructor() { 23 | 24 | this.options = { // not used, by default it'll use peerjs server 25 | key: 'cd1ft79ro8g833di', 26 | debug: 3 27 | }; 28 | } 29 | 30 | getMedia() { 31 | navigator.getUserMedia({ audio: true, video: true }, (stream) => { 32 | this.handleSuccess(stream); 33 | }, (error) => { 34 | this.handleError(error); 35 | }); 36 | } 37 | 38 | async init(userId: string, myEl: HTMLMediaElement, partnerEl: HTMLMediaElement) { 39 | this.myEl = myEl; 40 | this.partnerEl = partnerEl; 41 | try { 42 | this.getMedia(); 43 | } catch (e) { 44 | this.handleError(e); 45 | } 46 | await this.createPeer(userId); 47 | } 48 | 49 | async createPeer(userId: string) { 50 | this.peer = new Peer(userId); 51 | this.peer.on('open', () => { 52 | this.wait(); 53 | }); 54 | } 55 | 56 | call(partnerId: string) { 57 | const call = this.peer.call(partnerId, this.myStream); 58 | call.on('stream', (stream) => { 59 | this.partnerEl.srcObject = stream; 60 | }); 61 | } 62 | 63 | wait() { 64 | this.peer.on('call', (call) => { 65 | call.answer(this.myStream); 66 | call.on('stream', (stream) => { 67 | this.partnerEl.srcObject = stream; 68 | }); 69 | }); 70 | } 71 | 72 | handleSuccess(stream: MediaStream) { 73 | this.myStream = stream; 74 | this.myEl.srcObject = stream; 75 | } 76 | 77 | handleError(error: any) { 78 | if (error.name === 'ConstraintNotSatisfiedError') { 79 | const v = constraints.video; 80 | // this.errorMsg(`The resolution ${v.width.exact}x${v.height.exact} px is not supported by your device.`); 81 | this.errorMsg(`The resolution px is not supported by your device.`); 82 | } else if (error.name === 'PermissionDeniedError') { 83 | this.errorMsg('Permissions have not been granted to use your camera and ' + 84 | 'microphone, you need to allow the page access to your devices in ' + 85 | 'order for the demo to work.'); 86 | } 87 | this.errorMsg(`getUserMedia error: ${error.name}`, error); 88 | } 89 | 90 | errorMsg(msg: string, error?: any) { 91 | const errorElement = document.querySelector('#errorMsg'); 92 | errorElement.innerHTML += `

${msg}

`; 93 | if (typeof error !== 'undefined') { 94 | console.error(error); 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/assets/icon/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timsar2/ionic-video-call/50435dc4f969e533785688e61e8c9c2e29e31471/src/assets/icon/favicon.png -------------------------------------------------------------------------------- /src/assets/shapes.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /src/global.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * App Global CSS 3 | * ---------------------------------------------------------------------------- 4 | * Put style rules here that you want to apply globally. These styles are for 5 | * the entire app and not just one component. Additionally, this file can be 6 | * used as an entry point to import other CSS/Sass files to be included in the 7 | * output CSS. 8 | * For more information on global stylesheets, visit the documentation: 9 | * https://ionicframework.com/docs/layout/global-stylesheets 10 | */ 11 | 12 | /* Core CSS required for Ionic components to work properly */ 13 | @import "~@ionic/angular/css/core.css"; 14 | 15 | /* Basic CSS for apps built with Ionic */ 16 | @import "~@ionic/angular/css/normalize.css"; 17 | @import "~@ionic/angular/css/structure.css"; 18 | @import "~@ionic/angular/css/typography.css"; 19 | @import '~@ionic/angular/css/display.css'; 20 | 21 | /* Optional CSS utils that can be commented out */ 22 | @import "~@ionic/angular/css/padding.css"; 23 | @import "~@ionic/angular/css/float-elements.css"; 24 | @import "~@ionic/angular/css/text-alignment.css"; 25 | @import "~@ionic/angular/css/text-transformation.css"; 26 | @import "~@ionic/angular/css/flex-utils.css"; 27 | 28 | @media (prefers-color-scheme: dark) { 29 | /* 30 | * Dark Colors 31 | * ------------------------------------------- 32 | */ 33 | 34 | body { 35 | --ion-color-primary: #428cff; 36 | --ion-color-primary-rgb: 66,140,255; 37 | --ion-color-primary-contrast: #ffffff; 38 | --ion-color-primary-contrast-rgb: 255,255,255; 39 | --ion-color-primary-shade: #3a7be0; 40 | --ion-color-primary-tint: #5598ff; 41 | 42 | --ion-color-secondary: #50c8ff; 43 | --ion-color-secondary-rgb: 80,200,255; 44 | --ion-color-secondary-contrast: #ffffff; 45 | --ion-color-secondary-contrast-rgb: 255,255,255; 46 | --ion-color-secondary-shade: #46b0e0; 47 | --ion-color-secondary-tint: #62ceff; 48 | 49 | --ion-color-tertiary: #6a64ff; 50 | --ion-color-tertiary-rgb: 106,100,255; 51 | --ion-color-tertiary-contrast: #ffffff; 52 | --ion-color-tertiary-contrast-rgb: 255,255,255; 53 | --ion-color-tertiary-shade: #5d58e0; 54 | --ion-color-tertiary-tint: #7974ff; 55 | 56 | --ion-color-success: #2fdf75; 57 | --ion-color-success-rgb: 47,223,117; 58 | --ion-color-success-contrast: #000000; 59 | --ion-color-success-contrast-rgb: 0,0,0; 60 | --ion-color-success-shade: #29c467; 61 | --ion-color-success-tint: #44e283; 62 | 63 | --ion-color-warning: #ffd534; 64 | --ion-color-warning-rgb: 255,213,52; 65 | --ion-color-warning-contrast: #000000; 66 | --ion-color-warning-contrast-rgb: 0,0,0; 67 | --ion-color-warning-shade: #e0bb2e; 68 | --ion-color-warning-tint: #ffd948; 69 | 70 | --ion-color-danger: #ff4961; 71 | --ion-color-danger-rgb: 255,73,97; 72 | --ion-color-danger-contrast: #ffffff; 73 | --ion-color-danger-contrast-rgb: 255,255,255; 74 | --ion-color-danger-shade: #e04055; 75 | --ion-color-danger-tint: #ff5b71; 76 | 77 | --ion-color-dark: #f4f5f8; 78 | --ion-color-dark-rgb: 244,245,248; 79 | --ion-color-dark-contrast: #000000; 80 | --ion-color-dark-contrast-rgb: 0,0,0; 81 | --ion-color-dark-shade: #d7d8da; 82 | --ion-color-dark-tint: #f5f6f9; 83 | 84 | --ion-color-medium: #989aa2; 85 | --ion-color-medium-rgb: 152,154,162; 86 | --ion-color-medium-contrast: #000000; 87 | --ion-color-medium-contrast-rgb: 0,0,0; 88 | --ion-color-medium-shade: #86888f; 89 | --ion-color-medium-tint: #a2a4ab; 90 | 91 | --ion-color-light: #222428; 92 | --ion-color-light-rgb: 34,36,40; 93 | --ion-color-light-contrast: #ffffff; 94 | --ion-color-light-contrast-rgb: 255,255,255; 95 | --ion-color-light-shade: #1e2023; 96 | --ion-color-light-tint: #383a3e; 97 | } 98 | 99 | /* 100 | * iOS Dark Theme 101 | * ------------------------------------------- 102 | */ 103 | 104 | .ios body { 105 | --ion-background-color: #000000; 106 | --ion-background-color-rgb: 0,0,0; 107 | 108 | --ion-text-color: #ffffff; 109 | --ion-text-color-rgb: 255,255,255; 110 | 111 | --ion-color-step-50: #0d0d0d; 112 | --ion-color-step-100: #1a1a1a; 113 | --ion-color-step-150: #262626; 114 | --ion-color-step-200: #333333; 115 | --ion-color-step-250: #404040; 116 | --ion-color-step-300: #4d4d4d; 117 | --ion-color-step-350: #595959; 118 | --ion-color-step-400: #666666; 119 | --ion-color-step-450: #737373; 120 | --ion-color-step-500: #808080; 121 | --ion-color-step-550: #8c8c8c; 122 | --ion-color-step-600: #999999; 123 | --ion-color-step-650: #a6a6a6; 124 | --ion-color-step-700: #b3b3b3; 125 | --ion-color-step-750: #bfbfbf; 126 | --ion-color-step-800: #cccccc; 127 | --ion-color-step-850: #d9d9d9; 128 | --ion-color-step-900: #e6e6e6; 129 | --ion-color-step-950: #f2f2f2; 130 | 131 | --ion-toolbar-background: #0d0d0d; 132 | 133 | --ion-item-background: #1c1c1c; 134 | --ion-item-background-activated: #313131; 135 | } 136 | 137 | 138 | /* 139 | * Material Design Dark Theme 140 | * ------------------------------------------- 141 | */ 142 | 143 | .md body { 144 | --ion-background-color: #121212; 145 | --ion-background-color-rgb: 18,18,18; 146 | 147 | --ion-text-color: #ffffff; 148 | --ion-text-color-rgb: 255,255,255; 149 | 150 | --ion-border-color: #222222; 151 | 152 | --ion-color-step-50: #1e1e1e; 153 | --ion-color-step-100: #2a2a2a; 154 | --ion-color-step-150: #363636; 155 | --ion-color-step-200: #414141; 156 | --ion-color-step-250: #4d4d4d; 157 | --ion-color-step-300: #595959; 158 | --ion-color-step-350: #656565; 159 | --ion-color-step-400: #717171; 160 | --ion-color-step-450: #7d7d7d; 161 | --ion-color-step-500: #898989; 162 | --ion-color-step-550: #949494; 163 | --ion-color-step-600: #a0a0a0; 164 | --ion-color-step-650: #acacac; 165 | --ion-color-step-700: #b8b8b8; 166 | --ion-color-step-750: #c4c4c4; 167 | --ion-color-step-800: #d0d0d0; 168 | --ion-color-step-850: #dbdbdb; 169 | --ion-color-step-900: #e7e7e7; 170 | --ion-color-step-950: #f3f3f3; 171 | 172 | --ion-item-background: #1A1B1E; 173 | } 174 | 175 | ion-title.title-large { 176 | --color: white; 177 | } 178 | } -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ionic App 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | import './zone-flags'; 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by default for Angular itself. 59 | */ 60 | 61 | import 'zone.js/dist/zone'; // Included with Angular CLI. 62 | 63 | 64 | /*************************************************************************************************** 65 | * APPLICATION IMPORTS 66 | */ 67 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /src/theme/variables.scss: -------------------------------------------------------------------------------- 1 | // Ionic Variables and Theming. For more info, please see: 2 | // http://ionicframework.com/docs/theming/ 3 | 4 | /** Ionic CSS Variables **/ 5 | :root { 6 | /** primary **/ 7 | --ion-color-primary: #3880ff; 8 | --ion-color-primary-rgb: 56, 128, 255; 9 | --ion-color-primary-contrast: #ffffff; 10 | --ion-color-primary-contrast-rgb: 255, 255, 255; 11 | --ion-color-primary-shade: #3171e0; 12 | --ion-color-primary-tint: #4c8dff; 13 | 14 | /** secondary **/ 15 | --ion-color-secondary: #3dc2ff; 16 | --ion-color-secondary-rgb: 61, 194, 255; 17 | --ion-color-secondary-contrast: #ffffff; 18 | --ion-color-secondary-contrast-rgb: 255, 255, 255; 19 | --ion-color-secondary-shade: #36abe0; 20 | --ion-color-secondary-tint: #50c8ff; 21 | 22 | /** tertiary **/ 23 | --ion-color-tertiary: #5260ff; 24 | --ion-color-tertiary-rgb: 82, 96, 255; 25 | --ion-color-tertiary-contrast: #ffffff; 26 | --ion-color-tertiary-contrast-rgb: 255, 255, 255; 27 | --ion-color-tertiary-shade: #4854e0; 28 | --ion-color-tertiary-tint: #6370ff; 29 | 30 | /** success **/ 31 | --ion-color-success: #2dd36f; 32 | --ion-color-success-rgb: 45, 211, 111; 33 | --ion-color-success-contrast: #ffffff; 34 | --ion-color-success-contrast-rgb: 255, 255, 255; 35 | --ion-color-success-shade: #28ba62; 36 | --ion-color-success-tint: #42d77d; 37 | 38 | /** warning **/ 39 | --ion-color-warning: #ffc409; 40 | --ion-color-warning-rgb: 255, 196, 9; 41 | --ion-color-warning-contrast: #000000; 42 | --ion-color-warning-contrast-rgb: 0, 0, 0; 43 | --ion-color-warning-shade: #e0ac08; 44 | --ion-color-warning-tint: #ffca22; 45 | 46 | /** danger **/ 47 | --ion-color-danger: #eb445a; 48 | --ion-color-danger-rgb: 235, 68, 90; 49 | --ion-color-danger-contrast: #ffffff; 50 | --ion-color-danger-contrast-rgb: 255, 255, 255; 51 | --ion-color-danger-shade: #cf3c4f; 52 | --ion-color-danger-tint: #ed576b; 53 | 54 | /** dark **/ 55 | --ion-color-dark: #222428; 56 | --ion-color-dark-rgb: 34, 36, 40; 57 | --ion-color-dark-contrast: #ffffff; 58 | --ion-color-dark-contrast-rgb: 255, 255, 255; 59 | --ion-color-dark-shade: #1e2023; 60 | --ion-color-dark-tint: #383a3e; 61 | 62 | /** medium **/ 63 | --ion-color-medium: #92949c; 64 | --ion-color-medium-rgb: 146, 148, 156; 65 | --ion-color-medium-contrast: #ffffff; 66 | --ion-color-medium-contrast-rgb: 255, 255, 255; 67 | --ion-color-medium-shade: #808289; 68 | --ion-color-medium-tint: #9d9fa6; 69 | 70 | /** light **/ 71 | --ion-color-light: #f4f5f8; 72 | --ion-color-light-rgb: 244, 245, 248; 73 | --ion-color-light-contrast: #000000; 74 | --ion-color-light-contrast-rgb: 0, 0, 0; 75 | --ion-color-light-shade: #d7d8da; 76 | --ion-color-light-tint: #f5f6f9; 77 | } 78 | -------------------------------------------------------------------------------- /src/zone-flags.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Prevents Angular change detection from 3 | * running with certain Web Component callbacks 4 | */ 5 | (window as any).__Zone_disable_customElements = true; 6 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts", 9 | "src/polyfills.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "esnext", 9 | "moduleResolution": "node", 10 | "esModuleInterop": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "target": "es2015", 15 | "typeRoots": [ 16 | "node_modules/@types" 17 | ], 18 | "lib": [ 19 | "es2018", 20 | "dom" 21 | ] 22 | }, 23 | "angularCompilerOptions": { 24 | "fullTemplateTypeCheck": true, 25 | "strictInjectionParameters": true 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/zone-flags.ts", 13 | "src/polyfills.ts" 14 | ], 15 | "include": [ 16 | "src/**/*.spec.ts", 17 | "src/**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "array-type": false, 8 | "arrow-parens": false, 9 | "deprecation": { 10 | "severity": "warn" 11 | }, 12 | "import-blacklist": [ 13 | true, 14 | "rxjs/Rx" 15 | ], 16 | "interface-name": false, 17 | "max-classes-per-file": false, 18 | "max-line-length": [ 19 | true, 20 | 140 21 | ], 22 | "member-access": false, 23 | "member-ordering": [ 24 | true, 25 | { 26 | "order": [ 27 | "static-field", 28 | "instance-field", 29 | "static-method", 30 | "instance-method" 31 | ] 32 | } 33 | ], 34 | "no-consecutive-blank-lines": false, 35 | "no-console": [ 36 | true, 37 | "debug", 38 | "info", 39 | "time", 40 | "timeEnd", 41 | "trace" 42 | ], 43 | "no-empty": false, 44 | "no-inferrable-types": [ 45 | true, 46 | "ignore-params" 47 | ], 48 | "no-non-null-assertion": true, 49 | "no-redundant-jsdoc": true, 50 | "no-switch-case-fall-through": true, 51 | "no-use-before-declare": true, 52 | "no-var-requires": false, 53 | "object-literal-key-quotes": [ 54 | true, 55 | "as-needed" 56 | ], 57 | "object-literal-sort-keys": false, 58 | "ordered-imports": false, 59 | "quotemark": [ 60 | true, 61 | "single" 62 | ], 63 | "trailing-comma": false, 64 | "no-output-on-prefix": true, 65 | "no-inputs-metadata-property": true, 66 | "no-host-metadata-property": true, 67 | "no-input-rename": true, 68 | "no-output-rename": true, 69 | "use-lifecycle-interface": true, 70 | "use-pipe-transform-interface": true, 71 | "one-variable-per-declaration": false, 72 | "component-class-suffix": [true, "Page", "Component"], 73 | "directive-class-suffix": true, 74 | "directive-selector": [ 75 | true, 76 | "attribute", 77 | "app", 78 | "camelCase" 79 | ], 80 | "component-selector": [ 81 | true, 82 | "element", 83 | "app", 84 | "page", 85 | "kebab-case" 86 | ] 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /typings/cordova-typings.d.ts: -------------------------------------------------------------------------------- 1 | 2 | /// 3 | /// --------------------------------------------------------------------------------