Skip to content

Commit

Permalink
Merge pull request #241 from videogular/fix/fullscreen-button
Browse files Browse the repository at this point in the history
fix(fullscreen): Fix fullscreen button
  • Loading branch information
Elecash authored Sep 21, 2016
2 parents d07ffbb + f4a3072 commit e9e0a36
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/vg-controls/vg-fullscreen/vg-fullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {VgAbstractControl} from '../vg-abstract-control';
},
template:
`<div class="icon"
[class.vg-icon-fullscreen]="!fsAPI.isFullscreen"
[class.vg-icon-fullscreen_exit]="fsAPI.isFullscreen">
[class.vg-icon-fullscreen]="!isFullscreen"
[class.vg-icon-fullscreen_exit]="isFullscreen">
</div>`,
styles: [`
:host {
Expand Down Expand Up @@ -40,12 +40,16 @@ export class VgFullscreen extends VgAbstractControl {
elem:HTMLElement;
vgFor:string;
target:Object;
fsAPI:VgFullscreenAPI;
isFullscreen:boolean = false;

constructor(ref:ElementRef, public API:VgAPI) {
super(API);
this.elem = ref.nativeElement;
this.fsAPI = VgFullscreenAPI;
VgFullscreenAPI.onChangeFullscreen.subscribe(this.onChangeFullscreen.bind(this));
}

onChangeFullscreen(fsState:boolean) {
this.isFullscreen = fsState;
}

onPlayerReady() {
Expand Down

0 comments on commit e9e0a36

Please sign in to comment.