在全屏上隐藏android导航栏

时间:2019-08-06 22:29:13

标签: javascript ionic-framework videogular

我使用videogular2通过ionic启动视频,但是在Android智能手机上,当我进入全屏模式时,底部导航栏不会隐藏。

html:

<vg-player (onPlayerReady)="onPlayerReady($event)">
    <div id="video-back-button" (click)="closeVideo()" [hidden]="">
      <ion-icon name="arrow-back"></ion-icon>
    </div>

    <video [vgMedia]="media" #media id="singleVideo" preload="auto" controls controlsList="nodownload" disablePictureInPicture>
      <source *ngFor="let video of sources" [src]="video.src" [type]="video.type">
    </video>
</vg-player>

ts:

public static VIDEO_URL = environment.videoUrl;
videoApi: VgAPI;

onPlayerReady(api: VgAPI) {
  this.videoApi = api;
}

launchVideo(video: Video): void {
  this.selectedVideo = video;
  this.sources = [];
  this.sources.push({
    src: `${TrainingPage.VIDEO_URL}/${video.link}`,
    type: 'video/mp4'
  });
  this.videoApi.getDefaultMedia().currentTime = 0;
  this.videoApi.getDefaultMedia().subscriptions.canPlay.subscribe(() => this.videoApi.play());
}

或者在Ionic应用程序中使用videogular2可能不是一个好主意。

我该如何解决问题?

0 个答案:

没有答案