Log in or register to post comments

VideoPlayback doesn't go full screen on double tap

November 14, 2013 - 9:21am #1

I'm having trouble getting the video to change to fullscreen when the user double taps the video. I've tracked the code down to these two segments.

 

VideoPlaybackController.cs : 

private void HandleDoubleTap()
    {
        // Find out which video was tapped, if any
        VideoPlaybackBehaviour video = PickVideo(mTouchStartPos);

        if (video != null)
        {
            //if (video.VideoPlayer.IsPlayableFullscreen())
           // {
                // Pause the video if it is currently playing
                video.VideoPlayer.Pause();

                // Seek the video to the beginning();
                video.VideoPlayer.SeekTo(0.0f);

                // Display the busy icon
                video.ShowBusyIcon();

                // Play the video full screen
                video.VideoPlayer.Play(true, 0);
                mWentToFullScreen = true;
            //}
        }
    }

and this one

VideoPlayerHelper.cs :

public bool Play(bool fullScreen, float seekPosition)
    {
        // On Android we use Unity's built-in full screen movie player

        // On iOS we overlay a native full screen player as a new subview of the main window
        // (note that the Unity engine is not paused in this case)
		
        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);
        }
    }

 

I debugged to make sure that all the variables were correct, including the mFullScreenFilename variable. It was the right filename but there was no path, it was just the filename. I'm not sure if there needs to be a full path associated or not. Also, I'm using an mp4 video if that helps.

Any ideas as to why it's not working, or maybe something I've missed?

VideoPlayback doesn't go full screen on double tap

November 14, 2013 - 9:42am #3

Thanks, love unity but they did a poor job with this. There should definitely be an error in the log just like when it says you can't use plugins without unity pro. 

VideoPlayback doesn't go full screen on double tap

November 14, 2013 - 9:40am #2

EDIT:

Not using unity Pro though, I just read that this might be the issue.... Is that possible?

 

Yes, as the fullscreen player is a Unity Pro feature.

Log in or register to post comments