media.playVideo orientation problem.

Hello everyone,

I want to play a video in landscape mode. But Alas! it’s being displayed in Potrait mode.

My build.setting file is configured properly. My whole game is in landscape mode but this video orientation thing is disturbing everything.

My code is

media.playVideo("media/ending.mp4", false)

My build.setting code is

settings = {          android =     {         usesPermissions =         {             "android.permission.VIBRATE",         },     },     orientation = {         default = "landscapeRight",         supported = { "landscapeRight", "landscapeLeft"}     },          iphone = {                                    plist = {                          UIAppFonts =             {                 "Literaturnaya Book.ttf"               },             UIStatusBarHidden = false,             UIPrerenderedIcon = false,             UIApplicationExitsOnSuspend = true,         },     },           androidPermissions =     {             "android.permission.INTERNET",             "android.permission.ACCESS\_NETWORK\_STATE"     },      android =        {               usesPermissions =               {                                    "android.permission.INTERNET",                   "android.permission.ACCESS\_WIFI\_STATE",                   "android.permission.READ\_PHONE\_STATE",                   "android.permission.ACCESS\_NETWORK\_STATE",                                  },        }, }

Any help would be highly appreciated,

Thanks,

Hi @fazilreyaz,

Can you please post the contents of your “config.lua” file as well? I’d like to inspect that…

Thanks,

Brent

Below is the code of config.lua file

application = {     content =     {                  graphicsCompatibility = 1,         width = 476,         height = 856,         scale = "letterbox",                imageSuffix =         {             ["-iphone3"] = 0.5,             ["-ipad2"] = 1.066,             ["-ipad3"] = 2.133,                    },     } }

Hi @fazilreyaz,

Thanks for the info. I suggest you switch from “media.playVideo()” to “native.newVideo()” which provides a bit more flexibility:

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

Brent

But It doesn’t work with android?

I want to make it work on all the devices.

Yes, it works for both Android and iOS.

Hi @fazilreyaz,

Can you please post the contents of your “config.lua” file as well? I’d like to inspect that…

Thanks,

Brent

Below is the code of config.lua file

application = {     content =     {                  graphicsCompatibility = 1,         width = 476,         height = 856,         scale = "letterbox",                imageSuffix =         {             ["-iphone3"] = 0.5,             ["-ipad2"] = 1.066,             ["-ipad3"] = 2.133,                    },     } }

Hi @fazilreyaz,

Thanks for the info. I suggest you switch from “media.playVideo()” to “native.newVideo()” which provides a bit more flexibility:

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

Brent

But It doesn’t work with android?

I want to make it work on all the devices.

Yes, it works for both Android and iOS.