Video rotation problem on Android

Greetings everyone,

We’ve encountered a problem where the video ( played with media.playvideo() ) rotates to portrait mode on Samsung Galaxy Note 3 but we haven’t seen it on Galaxy Nexus 4 and a Motorola android phone so we’re not sure about the scope of the problem.

If the screen rotation is locked, player can’t rotate the video back to landscape but if not, player can watch the video in it’s original mode if they tilt the screen. After the video is played, the game is seen again in landscape mode. We’re not supporting the portrait mode in config.lua so I wasn’t able to find any solution to this. Is there something I’m missing or is this a bug on Corona’s end?

Can you post your build.settings file?  That’s where orientation is maintained.  Video is usually considered preferable in landscape mode and if it’s behaving correctly on 2 of your 3 devices, I’m wondering if something is setup differently on the one with the issue.  It’s also possible that Samsung did something (or even the Carrier for that matter) to affect this.

Rob

I’m using the same build.settings for both iOS and Android but I’ve only seen it on Android devices. By the way, update on the issue, it slipped my attention that I haven’t tried locking screen rotation on the other devices. It seems that the issue is Android-wide as I tried the same on the other devices.

Also, there’s one more issue with the media.playVideo: it overrides the " native.setProperty( “androidSystemUiVisibility”, “immersiveSticky” ) " code, the moment the video kicks in.

Anyway, here is my build.settings:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { plugins = { ["facebook"] = { publisherId = "com.coronalabs", }, }, orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" } }, iphone = { plist = { MinimumOSVersion = "7.0", UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend UIInterfaceOrientation = "UIInterfaceOrientationLandscapeRight", UISupportedInterfaceOrientations = { "UIInterfaceOrientationLandscapeRight", "UIInterfaceOrientationLandscapeLeft" }, CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png" }, UILaunchStoryboardName = "LaunchScreen", UIAppFonts = { "font1.ttf", "font2.otf", }, FacebookAppID = "key", --replace XXXXXXXXXX with your Facebook App ID CFBundleURLTypes = { { CFBundleURLSchemes = { "fbkey", } --replace XXXXXXXXXX with your Facebook App ID } }, ["URL types"] = { item = { ["URL Schemes"] = { ["Item 0"] = "fbkey" }, --replace XXXXXXXXXX with your Facebook App ID }, }, } }, android = { largeHeap = true, usesExpansionFile = true, usesPermissions = { "android.permission.INTERNET", "com.android.vending.CHECK\_LICENSE", "android.permission.WRITE\_EXTERNAL\_STORAGE" } }, }

I’m having a little trouble following what is working, what isn’t.  Can you re-summarize the problems with specifics.

Thanks

Rob

Sure. Videos played with media.playVideo() rotates when the player has locked their screen for rotation on Android devices.

Also, there is another problem related with media.playVideo(): it overrides " native.setProperty( “androidSystemUiVisibility”, “immersiveSticky” ) " code, the moment the video kicks in.

Can I get you to file a bug report on this?

Use the report a bug link at the top of the page.  You will need a minimal app that demonstrates the problems.  I would suggest you file two different bug reports, one focused on the rotation issue, one focused on the status bar issue.  Each project should contain the config.lua and build.settings needed to cause the problem (or have the expected behavior).  It should include any assets needed to run the app.  It all needs to be put in a .zip file (please don’t use any other compression/archive methods) and submitted as part of that form.

Once you get the bugs filed, you will get an email.  There will be a Case # in each.  Please post them back here as a reference.

Rob

Sorry for my late answer Rob. I’ll do it as soon as I find my way to my development machine and post the case numbers here.

Hi Rob,

Here are the case numbers:

#37528: Video rotation case

#37531: “androidSystemUiVisibility” option override

I didn’t include the video files because they make the sample code ~30 mb. Other than that, everything is in place.

Can you post your build.settings file?  That’s where orientation is maintained.  Video is usually considered preferable in landscape mode and if it’s behaving correctly on 2 of your 3 devices, I’m wondering if something is setup differently on the one with the issue.  It’s also possible that Samsung did something (or even the Carrier for that matter) to affect this.

Rob

I’m using the same build.settings for both iOS and Android but I’ve only seen it on Android devices. By the way, update on the issue, it slipped my attention that I haven’t tried locking screen rotation on the other devices. It seems that the issue is Android-wide as I tried the same on the other devices.

Also, there’s one more issue with the media.playVideo: it overrides the " native.setProperty( “androidSystemUiVisibility”, “immersiveSticky” ) " code, the moment the video kicks in.

Anyway, here is my build.settings:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { plugins = { ["facebook"] = { publisherId = "com.coronalabs", }, }, orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" } }, iphone = { plist = { MinimumOSVersion = "7.0", UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend UIInterfaceOrientation = "UIInterfaceOrientationLandscapeRight", UISupportedInterfaceOrientations = { "UIInterfaceOrientationLandscapeRight", "UIInterfaceOrientationLandscapeLeft" }, CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png" }, UILaunchStoryboardName = "LaunchScreen", UIAppFonts = { "font1.ttf", "font2.otf", }, FacebookAppID = "key", --replace XXXXXXXXXX with your Facebook App ID CFBundleURLTypes = { { CFBundleURLSchemes = { "fbkey", } --replace XXXXXXXXXX with your Facebook App ID } }, ["URL types"] = { item = { ["URL Schemes"] = { ["Item 0"] = "fbkey" }, --replace XXXXXXXXXX with your Facebook App ID }, }, } }, android = { largeHeap = true, usesExpansionFile = true, usesPermissions = { "android.permission.INTERNET", "com.android.vending.CHECK\_LICENSE", "android.permission.WRITE\_EXTERNAL\_STORAGE" } }, }

I’m having a little trouble following what is working, what isn’t.  Can you re-summarize the problems with specifics.

Thanks

Rob

Sure. Videos played with media.playVideo() rotates when the player has locked their screen for rotation on Android devices.

Also, there is another problem related with media.playVideo(): it overrides " native.setProperty( “androidSystemUiVisibility”, “immersiveSticky” ) " code, the moment the video kicks in.

Can I get you to file a bug report on this?

Use the report a bug link at the top of the page.  You will need a minimal app that demonstrates the problems.  I would suggest you file two different bug reports, one focused on the rotation issue, one focused on the status bar issue.  Each project should contain the config.lua and build.settings needed to cause the problem (or have the expected behavior).  It should include any assets needed to run the app.  It all needs to be put in a .zip file (please don’t use any other compression/archive methods) and submitted as part of that form.

Once you get the bugs filed, you will get an email.  There will be a Case # in each.  Please post them back here as a reference.

Rob

Sorry for my late answer Rob. I’ll do it as soon as I find my way to my development machine and post the case numbers here.

Hi Rob,

Here are the case numbers:

#37528: Video rotation case

#37531: “androidSystemUiVisibility” option override

I didn’t include the video files because they make the sample code ~30 mb. Other than that, everything is in place.