Unity 5.1.1 - iOS Video Playback Issue iOS 6 & 7

Hey everyone,

I recently updated to Unity 5.1.1 and I noticed that my videos have not been playing full screen anymore on iOS 6 & iOS 7. They are in a small window to the bottom left of the screen & the done button is off screen. iOS 8 seems to be fine though. Attached is a screenshot of what I am seeing.

Is this a known bug and does anyone have a temporary fix for it?

Thanks!

For anyone looking for a temporary solution. The onUnityUpdateViewLayout method in MPVideoPlayer.mm seems to be the culprit.

The original code was setting the offset since rootview sizing is portrait & this is in landscape.

- (void)onUnityUpdateViewLayout
{
    UIView* rootView = GetAppController().rootView;
    self.frame    = movieView.frame    = rootView.bounds;
    self.center    = movieView.center    = rootView.center;
}

A simple fix for my uses was to simply set the frame & center to the same as the movie view.

- (void)onUnityUpdateViewLayout
{
    self.frame    = movieView.frame;
    self.center    = movieView.center;
}

Hope that helps!

Hi,

The fix is in the works, thanks :slight_smile:

from our tests it seems to be enough to kill center setting and just have
self.frame = movieView.frame = rootView.bounds;
can you please try it out?

That works fine for me.

Please , can you tell me where to find MPVideoPlayer.mm and edit it . cause I can’t find it in my exported xcode folder … it’s odd .
I use unity 4.6.7f1 and xcode 6.4 … thanks

You should be able to find ‘MPVideoPlayer.mm’ in Classes\Unity, but this has already been fixed and it should no longer be necessary to remove that line on the latest 5.1 build.

I use 5.1.3f1 and MPVideoPlayer.mm is not quite the same.

- (void)onUnityUpdateViewLayout
{
    UIView* rootView = GetAppController().rootView;
    self.frame = movieView.frame = rootView.bounds;
}

I change it to:

- (void)onUnityUpdateViewLayout
{
    self.frame = movieView.frame;
}

And it works!