File

src/app/components/content-viewer/content-viewer.component.ts

Implements

OnInit

Metadata

Index

Methods
Inputs

Constructor

constructor(screenOrientation: ScreenOrientation, statusBar: StatusBar, modalCtrl: ModalController)
Parameters :
Name Type Optional
screenOrientation ScreenOrientation No
statusBar StatusBar No
modalCtrl ModalController No

Inputs

playerConfig
Type : any

Methods

eventHandler
eventHandler(event)
Parameters :
Name Optional
event No
Returns : void
ionViewWillLeave
ionViewWillLeave()
Returns : void
ngOnInit
ngOnInit()
Returns : void
import { ModalController } from '@ionic/angular';
import {  Component, Input, OnInit } from '@angular/core';
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

@Component({
    selector: "content-viewer",
    templateUrl: './content-viewer.component.html',
    styleUrls: ['./content-viewer.component.scss'],
})
export class ContentViewerComponent implements OnInit {
  @Input() playerConfig: any;

  constructor(
    private screenOrientation: ScreenOrientation,
    private statusBar: StatusBar,
    private modalCtrl: ModalController
  ) {
    
  }

  ngOnInit() {
    this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
    this.statusBar.hide();
  }

  ionViewWillLeave() {
    this.statusBar.show();
    this.screenOrientation.unlock();
    this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
  }

  eventHandler(event) {
    if ((event === 'EXIT') || (event.edata && event.edata.type === 'EXIT')) {
      this.modalCtrl.dismiss();
    }
  }
}
<ion-content>
    <sunbird-video-player [playerConfig]="playerConfig" (playerEvent)="eventHandler($event)"></sunbird-video-player>
</ion-content>

./content-viewer.component.scss

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""