yanwsh / videojs-panorama

a plugin for videojs run a full 360 degree panorama video.
http://yanwsh.github.io/videojs-panorama/
Other
483 stars 160 forks source link

iframe-video - autoMobileOrientation #148

Open numericgraphics opened 6 years ago

numericgraphics commented 6 years ago

Hello, I implemented videojs-panorama in iframe with the postMessage configuration. The result is fine, but when i try to use the autoMobileOrientation mode, the plugin doesn't make difference between landscape and portrait mode. The result is inverted orientation in the portrait mode, moving top to bottom for showing left and right !

If i change the iframe dimensions having the height bigger than the width, the result is good and the orientation even in portrait mode.

In the Iframe-video.html example the autoMobileOrientation is set to false. But, in videojs-panorama.v5.js, in case of iframe you sended the event directly to the handleMobileOrientation function... Can you tell me more about this implementation, is it possible to use the mobile orientation ? Thx anyway for this and for your work ;-)

numericgraphics commented 6 years ago

After invertigation, i realized that the problem comes from the fact of the listener in the playOnMobile function and the direct call of the handleMobileOrientation function using the postMessage ... the portrait mode is false then true ... causing a bad behavior. Using var portrait = event.portrait, var landscape = event.landscape; directly the behavior in landscape mode is portrait is good. Do you have any advice to avoid modifying the handleMobileOrientation function? Have you ever encountered this problem? Thank you in advance.

numericgraphics commented 6 years ago

Please let me know, maybe it's not very clear !