Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kaihenzler committed Jun 17, 2019
1 parent 4a88de5 commit 1663ce5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 27 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,8 @@ Note that you can't use Electron or NodeJS native libraries in this case. Please
[github-star]: https://github.com/maximegris/angular-electron/stargazers
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20angular-electron!%20https://github.com/maximegris/angular-electron%20%F0%9F%91%8D
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/maximegris/angular-electron.svg?style=social

## Images

- Background Image of the rear view mirror (For Personal Use) - Source: https://www.kisspng.com/png-mac-app-store-macos-apple-rear-view-mirror-car-mir-1026435/download-png.html
- App Icon (For Personal Use) - Source: https://www.kisspng.com/png-car-computer-icons-rear-view-mirror-4290757/
9 changes: 1 addition & 8 deletions src/app/components/home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
align-items: center;
justify-content: center;

-webkit-background-size: cover; /* pour anciens Chrome et Safari */
-webkit-background-size: cover;

background-image: url("assets/rear-view-background.png");
background-repeat: no-repeat;
Expand All @@ -17,11 +17,4 @@
border-radius: 45px;
}
}

.title {
color: white;
margin:0;
padding:50px 20px;
}

}
32 changes: 13 additions & 19 deletions src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core';

@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit, AfterViewInit {
export class HomeComponent implements AfterViewInit {

@ViewChild('camera')
camera: ElementRef<HTMLVideoElement>;

constructor() {
}

ngOnInit() {

}

ngAfterViewInit(): void {
navigator.mediaDevices.getUserMedia({
video: {
width: 590,
height: 165,
}
})
.then((stream) => {
this.camera.nativeElement.srcObject = stream;
}).catch((e) => {
alert('could not connect stream ' + e);
});
async ngAfterViewInit() {
try {
this.camera.nativeElement.srcObject = await navigator.mediaDevices.getUserMedia({
video: {
width: 590,
height: 165,
}
});
} catch (e) {
alert('could not connect stream ' + e);
}
}

}

0 comments on commit 1663ce5

Please sign in to comment.