Log in or register to post comments

Vuforia video playback fullscreen iOS

March 20, 2013 - 2:55am #1

This is my first post so excuse me if it's an obvious thing !

I'm using the Unity videoplayback  and it works great in AR mode. When I switch to fullscreen mode, it also works fine unless you let the video play to the very end at which point it seems to be stuck. The screen stays black and won't switch back to the camera.

Vuforia video playback fullscreen iOS

July 29, 2013 - 6:23am #13

Solved! Thanks NalinS! It was plugin version issue.

Now I've realize about other problem... When I detect an image target some gui buttons are shown, and if you tap them open an url in the default browser, but when come back to the scene (through the back button in Android or home button in iOS), although the image target works fine, the video doesn't play when I tap the icon... Someone got something similar?

Vuforia video playback fullscreen iOS

July 26, 2013 - 7:10am #12

Try with the latest version of Unity and the latest Vuforia.

This thread seems to indicate it can be solved accordingly.

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/handheldplayfullscreenmovie-going-black

N

 

Vuforia video playback fullscreen iOS

July 26, 2013 - 7:04am #11

I have the same problem in iOS when the video reach the end -> black screen, nothing to do but force quit.

I've tried with this solution, forcing iOS to use the handheld player. I tap twice the video and the player start, show a loading icon and after a second close itself, going back to the scene again...

any idea what is happening?

 

I'm using unity 4.1.5, and iOS 6

Vuforia video playback fullscreen iOS

March 29, 2013 - 3:32am #10

I haven't had a chance to try it yet as I'm onto a different project but looking at it, it seems like it should be good on the iOS. We had similar issues but in reverse on Android devices. Once all the iOS code was stripped out for Android - it works. Worth looking out for.

Vuforia video playback fullscreen iOS

March 28, 2013 - 7:02am #9

Does anyone have an idea about my modification ?

I want to be sure that it will not cause problems that I didn't think :/

Vuforia video playback fullscreen iOS

March 27, 2013 - 1:28am #8

Hello everyone,

I have faced the same problem than redboot. When I launch a video and wait for its end, it stops on a black screen and don't go back to my application.

Digging into the code, I have fixed the problem doing so :

Replace :

 

if (fullScreen && (Application.platform == RuntimePlatform.Android))
        {
            if (mFilename == null)
            {
                return false;
            }

            Handheld.PlayFullScreenMovie(mFullScreenFilename, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFit);
            return true;
        }
        else
        {
            return videoPlayerPlay(fullScreen, seekPosition);
        }

With :

 if (fullScreen)
        {
            if (mFilename == null)
            {
                return false;
            }

            Handheld.PlayFullScreenMovie(mFullScreenFilename, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFit);
            return true;
        }
        else
        {
            return videoPlayerPlay(fullScreen, seekPosition);
        }

 

It seems to work fine, but I would like to be sure if there could be any side effect. Waht do you think about it ? (The only difference I can notice is the video orientation)

Thanks for you help :)

PS : I use Unity 4.0.0

 

 

 

Vuforia video playback fullscreen iOS

March 21, 2013 - 8:35am #7

Many thanks for sharing :)

N

Vuforia video playback fullscreen iOS

March 21, 2013 - 5:25am #6

 

 

Not sure if this will shed any light on it at all TBH but for what it's worth...

You are correct, I duplicated the class file first and made a CustomVideoPlaybackController script and commented out exactly as you've done. Essentially it's the same script though.

Of course it depends on your use case but for this I needed to have a 'play full screen' button available in AR mode as we considered the 'double tap' as not being obvious enough.

Some of the code is ommited here BTW. Just to give you a rough overview of what I did.

 

So I create a UIToolkit button in a UIBuilder class

 

var fullScreenbutton = UIButton.create( "FullScreenMode.png", "FullScreenMode.png", 0, 0 );

fullScreenbutton.positionFromBottomRight(0.05f,0.05f);

 

fullScreenbutton.onTouchUpInside += ( sender ) => fullScreenButtonBehaviour( sender );

fullScreenbutton.touchDownSound = buttonSound;

 

 

Simple enough and inside the same script I made this method

 

 public void fullScreenButtonBehaviour( UIButton sender )

{

 

//rest of script omitted… not important

 

 

//Actual call to play full screen

Handheld.PlayFullScreenMovie( video.m_path,Color.black,FullScreenMovieControlMode.CancelOnInput,FullScreenMovieScalingMode.AspectFit );

 

}

 

}

}

 

Its very simple. Essentially turning off the DoubleTap() call and therefore bypassing the code inside the VideoPlayerHelper class as that seems to me to be the thing that's the problem. The rest is fine. The code above is actually the same code from the VideoPlayerHelper class below marked in red (Maybe this is where the problem is ?) The only difference being I'm referencing my video directly using video.m_path rather than mFullScreenFilename.

 

#if UNITY_3_2 || UNITY_3_3 || UNITY_3_4

 

                iPhoneUtils.PlayMovie(mFullScreenFilename, Color.black, iPhoneMovieControlMode.CancelOnTouch, iPhoneMovieScalingMode.AspectFit);

            }

else

 

            Handheld.PlayFullScreenMovie(mFullScreenFilename,Color.black,FullScreenMovieControlMode.CancelOnInput,FullScreenMovieScalingMode.AspectFit );

#endif

            return true;

        }

        else

        {

            return videoPlayerPlay(fullScreen, seekPosition);

        }

    }

 

 

 

I tried playing my videos in full screen mode in different modes and they all play to the end and then go back to the AR mode and it works ! :) 

 

Of course it's a total hack and I'm sure there's a more elegant way of doing it. Plus it's working to a very specific situation and may not work for everyone.

 

It's kind of weird as it's more or less doing the same thing as the DoubleTap() method ??? Maybe it's to do with the fact it has to redraw the UIToolkit button after playing the video ?

 

 

 

 

 

 

 

 

Vuforia video playback fullscreen iOS

March 21, 2013 - 4:03am #5

Hi redboot,

It's awesome that you manage to fix this.

Could I please trouble you for a little more detail as I would like to try this out as well so that we can share as a workaround if anybody else has a similar problem?

So my understanding so far is that in VideoPlaybackController.cs you commented out the HandleDoubleTap() as below:

 

            else if (touch.phase == TouchPhase.Ended)

            {

                if (!mTouchMoved && mTimeElapsed < 1.0)

                {

                    if (mTapped)

                    {

                        // Second tap

//                        HandleDoubleTap();

                        mTapped = false;

                    }

                    else

                    {

                        // Wait to see if this is a double tap

                        mTapped = true;

                        mTimeElapsedSinceTap = 0.0f;

                    }

                }

            }

 

Next you made a UIToolkit button to go to full screen mode instead - how, exactly?  and when does the user need to press it etc.?

Anything else you can share would be much appreciated.

N

 

 

 

Vuforia video playback fullscreen iOS

March 20, 2013 - 11:58am #4

I ended up switching off the DoubleTap() method inside Vuforia and made a UIToolkit button to go to full screen mode instead. Made the call from the buttons controller instead and it works ! Video plays to the end and then back into AR mode. Still not sure why that made a difference but it's got the app working how I want.

Vuforia video playback fullscreen iOS

March 20, 2013 - 5:07am #3

Thanks NalinS. I'll take a look.

Vuforia video playback fullscreen iOS

March 20, 2013 - 5:02am #2

Hi redboot,

This seems to be a known issue on the Unity / iOS side - though it seems to be more related to iOS6

Some have managed to roll their own solution as per this thread:

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/videoplayback-error-video-end

 

Have you tried with different versions of Unity / iOS?

N

 

BTW next time try posting in the Unity forums here rather than General Discussion

Log in or register to post comments