<commit_before>/**
 * Created by natha on 21.01.2017.
 */
import {Component, ViewChildren, NgZone} from '@angular/core';
import {ipcRenderer} from 'electron';
import {DomSanitizer} from "@angular/platform-browser";
import {Mediatype} from "../../shared/enum/mediaType";



@Component({
    selector: 'beamer-display',
    templateUrl: 'app/components/beamer/beamer.component.html',
    styleUrls: ['app/components/beamer/beamer.component.css']
})

export class BeamerComponent {
    randomNumber:Number = 0;
    brightPerc:Number = 0;
    medias:Object[];
    mediaType = Mediatype;
    @ViewChildren('videoP') videos;

    constructor(public zone: NgZone, private sanitizer:DomSanitizer) {
        this.randomNumber = 1;
        this.brightPerc = 20;
        this.medias = [];
    }

    ngOnInit() {
        ipcRenderer.on('brightness-changed', (event, arg) => {
            this.zone.run(() => this.brightPerc = arg);
        });

        ipcRenderer.on('media-changed', (event, arg) => {
            this.zone.run(() => this.medias = arg);
        });
    }

    ngAfterViewInit() {
        for (let i = 0; i < this.videos._results.length; i++) {
            let video = this.videos._results[i];
            video.nativeElement.autoplay = true;
            if (video.nativeElement.paused) {
                video.nativeElement.play();
            }
        }
    }

    getStyle() {
        return this.sanitizer.bypassSecurityTrustStyle('brightness(' + this.brightPerc + '%)');
    }
}<commit_msg>updated beamer<commit_after>/**
 * Created by natha on 21.01.2017.
 */
import {Component, ViewChildren, NgZone} from '@angular/core';
import {ipcRenderer} from 'electron';
import {DomSanitizer} from "@angular/platform-browser";
import {Mediatype} from "../../shared/enum/mediaType";



@Component({
    selector: 'beamer-display',
    templateUrl: 'app/components/beamer/beamer.component.html',
    styleUrls: ['app/components/beamer/beamer.component.css']
})

export class BeamerComponent {
    randomNumber:Number = 0;
    brightPerc:Number = 0;
    medias:Object[];
    mediaType = Mediatype;
    @ViewChildren('videoP') videos;

    constructor(public zone: NgZone, private sanitizer:DomSanitizer) {
        this.randomNumber = 1;
        this.brightPerc = 20;
        this.medias = [];
    }

    ngOnInit() {
        ipcRenderer.on('brightness-changed', (event, arg) => {
            this.zone.run(() => this.brightPerc = arg);
        });

        ipcRenderer.on('media-changed', (event, arg) => {
            this.zone.run(() => this.medias = arg);
            this.playVideos();
        });
    }

    ngAfterViewInit() {
        this.playVideos();
    }

    playVideos() {
        for (let i = 0; i < this.videos._results.length; i++) {
            let video = this.videos._results[i];
            video.nativeElement.autoplay = true;
            if (video.nativeElement.paused) {
                video.nativeElement.play();
            }
        }
    }

    getStyle() {
        return this.sanitizer.bypassSecurityTrustStyle('brightness(' + this.brightPerc + '%)');
    }
}
{'fraction_non_alphanumeric': 0.15085788280997087, 'fraction_numerical': 0.009064422143088379, 'mean_word_length': 2.495475113122172, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3857343', 'n_tokens_mistral': 1021, 'n_tokens_neox': 955, 'n_words': 176}