angular-bigscreen
AngularBigScreen is an Angular service to quickly use the HTML5 fullscreen API.
Install
-
Install angular-bigscreen
node module through npm:
$ npm install angular-bigscreen --save
-
Import BigScreenService
to your AppModule
import { BigScreenService } from 'angular-bigscreen';
@NgModule({
providers: [ BigScreenService ]
})
export class AppModule {
constructor(private bigScreenService: BigScreenService) {
}
}
Usage
For example:
this.bigScreenService.request(this.elementRed.nativeElement);
API
this.bigScreenService.isFullscreen()
Returns a boolean
. True if fullscreen is been used, else false.
this.bigScreenService.request(el: ElementRef)
Requests fullscreen in an ElementRef
.
this.bigScreenService.exit()
Exits from fullscreen.
this.bigScreenService.onChange(callback: any)
This is a wrapper for document.fullscreenchange
.
this.bigScreenService.onError(callback: any)
This is a wrapper for document.fullscreenerror
.
this.bigScreenService.element()
Returns an element. This is a wrapper for document.fullscreenElement
.
this.bigScreenService.enabled()
Returns a boolean
. Checks if fullscreen is enabled.
License
MIT. Copyright (c) Alex.