Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Orientation for HTML5 video only
Started by apps30 Oct 23 2018 08:55 PM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

apps30

[GLOBAL: userInfoPane.html]
apps30
  • Enthusiast

  • 52 posts
  • Corona SDK

I am building an android video app.

 

We don't allow the app to have orientation. So, I set the supported orientation to "portrait" only in build.settings.

 

And the video is embedded into a HTML5 video player (video tag) in the native.webview. (I don't use the media.newVideo() because we need the video to be played inline and media.newVideo seems only have full screen only)

 

I added a javascript to fire an event when user press "fullscreen" button in the html5 video player and I will update the url to tell corona to switch to fullscreen mode (hide all other display objects and make the webview fullscreen). However, the fullscreen video doesn't rotate with the device orientation. 

 

I tried to add "landscapeLeft" and "landscapeRight" into build.settings. It can help to fix the problem. However, I don't want any display object to rotate beside the webview in fullscreen (html5 video).

 

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,860 posts
  • Corona Staff

Have you tried to rotate the webView when you detect the device rotates?

 

Rob



[TOPIC: post.html]
#3

apps30

[GLOBAL: userInfoPane.html]
apps30
  • Enthusiast

  • 52 posts
  • Corona SDK

yes. I did but doesn't work.

 

The docs also say that webview rotation is supported in iOS only:

https://docs.coronalabs.com/api/library/native/newWebView.html

 

Any idea or workaround?



[TOPIC: post.html]
#4

apps30

[GLOBAL: userInfoPane.html]
apps30
  • Enthusiast

  • 52 posts
  • Corona SDK

any solution?




[topic_controls]
[/topic_controls]