在Ionic App中以横向全屏播放视频

San*_*nde 3 javascript html5 cordova ionic-framework ionic

我有问题播放视频横向全屏模式.请帮我在横向全屏显示视频.

我使用以下代码在Ionic中查看模板.

<ion-view view-title="Poem" hide-nav-bar="true">
    <div class="modal transparent fullscreen-player">
          <video id="myvideo" ng-src="{{clipSrc}}" class="centerme" controls="controls" autoplay poster="{{bg}}"></video>
    </div>
</ion-view>
Run Code Online (Sandbox Code Playgroud)

控制器代码如下:

.controller('PoemDetailCtrl', function($scope) {
      $scope.clipSrc = '/android_asset/www/video/demo.mp4'
      $scope.bg = 'img/poems/01.png';
      var video = document.getElementById("myvideo");
      if (video.requestFullscreen) {
        video.requestFullscreen();
      } else if (video.msRequestFullscreen) {
        video.msRequestFullscreen();
      } else if (video.mozRequestFullScreen) {
        video.mozRequestFullScreen();
      } else if (video.webkitRequestFullscreen) {
        video.webkitRequestFullscreen();
      }
})
Run Code Online (Sandbox Code Playgroud)

我在android设备中得到以下输出

在此输入图像描述

我想默认输出如下:

在此输入图像描述

小智 5

https://github.com/gbenvenuti/cordova-plugin-screen-orientation

您可以使用此插件来强制用户设备在打开视频时更改方向