moust / cordova-plugin-videoplayer

A Codova plugin to play video with the native MediaPlayer on Android devices.
MIT License
139 stars 102 forks source link

Set oriantion #51

Open Ross-Rawlins opened 6 years ago

Ross-Rawlins commented 6 years ago

My app is locked into portrait mode but the video is landscaped how can I set this fix in the play options?

shyaaam commented 6 years ago

Facing the same issue. How to correct this? Looks bad in the app.

kiweb commented 6 years ago

I found a workaround for this. Use cordova-plugin-screen-orientation

When the video is triggered, lock the screen orientation to landscape, play the video, and then lock the orientation back to portrait when the video is completed, or if there's an error.

window.screen.orientation.lock('landscape');

VideoPlayer.play(scope.url, {}, function() {

    window.screen.orientation.lock('portrait');

}, function(err) {

    window.screen.orientation.lock('portrait');

});