Log in or register to post comments

Handheld.PlayFullScreenMovie Going black

November 20, 2012 - 12:29pm #1

I'm having issues attempting to play a full screen video in Unity 3.5.6f4 running iOS pro, xCode 4.5.2:

    var myObj:GameObject;
   
    function OnMouseDown(){
        Debug.Log("my mouse is down");
       
        Handheld.PlayFullScreenMovie ("MyVideo.m4v", Color.black, FullScreenMovieControlMode.CancelOnInput, FullScreenMovieScalingMode.AspectFit);
    }

 

After launching the app on an iPad(iOS 6) and clicking my game object, OnMouseDown trigger it appears that the click function is being fired, the video window slides in, fails to play the video, and immediately reverts back to the AR Camera view.

I am receiving the following warnings in the xCode Output log:

2012-11-20 14:58:39.984 MyProject[4993:907] INFO/AR(4993) 2012-11-20 14:58:39: Triggering autofocus not supported
2012-11-20 14:58:39.986 MyProject[4993:907] INFO/AR(4993) 2012-11-20 14:58:39: Setting the torch mode not supported
2012-11-20 14:58:39.988 MyProject[4993:907] INFO/AR(4993) 2012-11-20 14:58:39: Setting the focus mode not supported

My theory is that maybe I have to disable the AR Camera in order to play a fullscreen video and re-enable the AR Camera once the video is finished playing. Are there any supporting script files that need to be included for basic video playback functionality?

Any help with this would be greatly appreciated.

Handheld.PlayFullScreenMovie Going black

November 17, 2014 - 2:11pm #35

Given that this thread is now 2 years old and the video playback code has been updated over numerous iterations, I was hoping that one of the moderators would be so kind to create a new thread/post sample code dedicated to creating a fullscreen video sample project in Unity. Perhaps this already exists? If so please post a link here.

It would be an added bonus to provide a recap on how to modify the VideoPlaybackController.cs script to force fullscreen video playback and perhaps create a pin on the Unity Extension forum front page.

Also, it would be nice to include an example regarding how to pause any other AR and/or audio instances once the the video player launches? I have a looping audio track that plays upon target recognition that I would like to pause when the video player is in action.

Thank you for all of the contributions to this topic and as always your help is much appreciated!

Handheld.PlayFullScreenMovie Going black

February 26, 2014 - 8:01am #34

sir. i've downloaded the videoplayback package in the asset store , i got the sample scene on that package and run it to my android device , when i scan the image target it show a play button but it won't play, i can't even tap or touch the play button.? what's the problem with that? is there a separate code for tap and touch ?

Handheld.PlayFullScreenMovie Going black

July 26, 2013 - 2:40am #33

Good to hear, and thanks for sharing :)

 

N

Handheld.PlayFullScreenMovie Going black

July 26, 2013 - 2:38am #32

Thank Nalin, that was the point. But only using the new Vuforia SDK didn´t solved the bug. Of course I had to use the current version of the VideoPlaybackDemo too. No it works! Thanks!

Handheld.PlayFullScreenMovie Going black

July 25, 2013 - 2:43am #31

Have you tried it with the latest version of Vuforia?

My understanding is that there should be no problem now.

N

Handheld.PlayFullScreenMovie Going black

July 25, 2013 - 2:35am #30

Any news on this bug? I use Unity 4.2 and iOS 6. The FullScreenVideo stays black or loading (depending on UI was shown or not), when the video ended.

Handheld.PlayFullScreenMovie Going black

May 17, 2013 - 3:09am #29

To be honest it is hard to be sure, because there are so many variables, though I do remember reading that some managed to find a workaround.

I am afraid you'll just have to try it and see, though please keep us informed and I'll feed it into the development team.

 

N

Handheld.PlayFullScreenMovie Going black

May 17, 2013 - 2:40am #28

No news on this?

btw, is this due to SDK version or OS-version? So compiled with iOS5 SDK it should work fine on an iOS6 device?

Handheld.PlayFullScreenMovie Going black

May 2, 2013 - 2:52am #27

This is not stricly a Vuforia issue, as it is dependent on iOS version and Unity version.

We are aware of the issue but no news as yet - sorry.

 

N

Handheld.PlayFullScreenMovie Going black

May 1, 2013 - 11:11am #26

Any update on getting this issue fixed using iOS 6 and Unity 4?

Handheld.PlayFullScreenMovie Going black

March 16, 2013 - 5:47pm #25

Can you achieve what you're looking for using our Video Playback features - e.g. using the VideoPlayerHelper and Controller classes?

 

Handheld.PlayFullScreenMovie Going black

March 16, 2013 - 1:27pm #24

Thanks for your suggestion.  While reverting to a previous version of Unity works to solve the issue,  it is not a solution to the problem because in doing so I'll lose the bug fixes and features from Unity 3.5.7f6 that I rely on for stability of my app.  Additionally, it would cause me to lose the newly added iPhone5 game views splash screen support, amongst other things.

I was able to hack n' slash the sample app's VideoPlaybackBehaviour script to get a workaround going for now until I can upgrade to 4.0+ which hopefully resolves the problems.

-Vince 

Handheld.PlayFullScreenMovie Going black

March 15, 2013 - 9:10am #23

The problem occured after Unity 3.5.5.  

The easiest way to solve the problem.  Just go back to Unity 3.5.5

Haven't test with unity 4.1

Handheld.PlayFullScreenMovie Going black

March 15, 2013 - 8:53am #22

I'm still having this issue running Vuforia 2.0 and Unity iOS/Android Pro version 3.5.7f6 and Xcode 4.5.2.

 

On Start() of a fresh scene, I call:

Handheld.PlayFullScreenMovie(videoPath, videoBackgroundColor);

From the console, this is the readout at the moment the video player attempts to play (i can see the transition happen and briefly see the native UI for the video player on iOS when I wrap the call into an IEnumerator and fire it on Start() by calling a coroutine with a short yield right after the Handheld call).  It then immediately calls my debug statement "Video Finished" after trying to enable autoplay and failing.

On iOS6 iPhone 4S:

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextSaveGState: invalid context 0x0

 

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextClipToRect: invalid context 0x0

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextTranslateCTM: invalid context 0x0

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextDrawShading: invalid context 0x0

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextRestoreGState: invalid context 0x0

2013-03-15 11:31:48.030 app[13468:907] [MPAVController] Autoplay: Disabling autoplay for pause

2013-03-15 11:31:48.031 app[13468:907] [MPAVController] Autoplay: Disabling autoplay

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextSaveGState: invalid context 0x0

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextClipToRect: invalid context 0x0

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextTranslateCTM: invalid context 0x0

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextDrawShading: invalid context 0x0

Mar 15 11:31:48 Phineas app[13468] <Error>: CGContextRestoreGState: invalid context 0x0

2013-03-15 11:31:48.123 app[13468:907] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)

2013-03-15 11:31:48.227 app[13468:907] [MPAVController] Autoplay: Enabling autoplay

2013-03-15 11:31:48.264 app[13468:907] [MPAVController] Autoplay: Likely to keep up or full buffer: 0

2013-03-15 11:31:48.265 app[13468:907] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.

2013-03-15 11:31:48.274 app[13468:907] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0

2013-03-15 11:31:48.328 app[13468:907] [MPAVController] Autoplay: Enabling autoplay

2013-03-15 11:31:48.359 app[13468:907] [MPAVController] Autoplay: Disabling autoplay for pause

2013-03-15 11:31:48.361 app[13468:907] [MPAVController] Autoplay: Disabling autoplay

Video Finished

 

 

The video I'm using was taken from an already published app that plays video on Android and iOS, so I know its the right format.

 

On iOS5.1 iPad3:

2013-03-15 11:50:30.689 app[6916:707] An instance 0x1d531e80 of class AVPlayerItem was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info:

<NSKeyValueObservationInfo 0x1f8d4f40> (

<NSKeyValueObservance 0x1faa2430: Observer: 0x1fac8250, Key path: nonForcedSubtitleDisplayEnabled, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x1fa7b4c0>

<NSKeyValueObservance 0x1f98dd50: Observer: 0x1fa3d0b0, Key path: presentationSize, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x1d5d4e70>

)

 

 

 

iOS 5.1 and 6.0 are showing different debugs but similar behaviour.

 

Any help would be greatly appreciated.  Upgrading to Unity 4.0 is not an option at the moment, so I'm hoping this issue can be resolved without the need to upgrade.  

 

- Vince

 

Handheld.PlayFullScreenMovie Going black

February 4, 2013 - 9:51am #21

Unity 3.5.5 works fine with iOS 6 and Xcode 4.6

Handheld.PlayFullScreenMovie Going black

February 4, 2013 - 9:12am #20

I have the issue with iOS 6 and Unity 4. Thanks.

Handheld.PlayFullScreenMovie Going black

February 4, 2013 - 8:36am #19

Does it work with iOS6?

What about other iOS versions?

N

Handheld.PlayFullScreenMovie Going black

February 4, 2013 - 8:29am #18

I delete Unity 3.5.6 and install 3.5.5f3...It works fine.

Handheld.PlayFullScreenMovie Going black

February 4, 2013 - 3:51am #17

Thanks for this.

This issue is currently under investigation and I will revert back when we have any more info.

N

Handheld.PlayFullScreenMovie Going black

February 3, 2013 - 5:37pm #16

I have the same issue.  Video playback turns black after the video finished on fullscreen mode.

I use unity 3.5, iOS 6.0 and 6.1

Ok, I have managed to

January 18, 2013 - 5:13am #15

Ok, I have managed to reproduce the issue, by amending the code in VideoPlayerHelper.cs to the following:

 

return videoPlayerPlay(true, seekPosition);

            

// original code

//return videoPlayerPlay(fullScreen, seekPosition);

 

though it does seem a little device specific:

  • iOS6 - seems to have a problem
  • iOS5 - seems fine
  • iOS4 - video seems to play from the start, but after this it appears to run fine

Can you please confirm the iOS version and device where you are encountering a problem?

 

thanks

N

Video Playback Fullscreen issues

January 17, 2013 - 11:55am #14

After upgrading to Vufroia 2.0, Unity 4, and xcode 4.5.2 I am still having the full-screen exiting issues. Once the video stops playing the screen goes black and there is no way to exit out of the video player.

I have been able to replicate the issue running the latest VideoPlayback example using the script provided by David Beard.

I'm in need of a function that could be added to the REACHED_END call that would force close the media player.

In addition to this issue, I was also wondering if there was a simple global function available to pause all audio within a scene while my video is playing and then resume the audio once the media player has closed.

Thanks again for the continued support!

Video Playback

December 17, 2012 - 8:30am #13

Hi Jeff,

Do you mean this thread?

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/lauch-movie-form-touching-object

sorry about the links but we are trying to fix this :)

My suggestion is to try it with Unity 4 and the latest Vuforia 2.0 (which fixes a couple of playback bugs as well) if at all possible, and yes it does work with the latest XCode.

HTH

N

Fullscreen Video Issues

December 17, 2012 - 7:51am #12

I'm using Unity Pro 3.5.6 and building for iOS with the latest version of xCode 4.5.2 and Vuforia 1.5.9.

Is Unity 4 now working with the latest version of xCode?

I was following a thread to be notified when this issue was resolved but it appears the thread no longer exists.

I've been able to replace the videos in the video playback sample and play within a texture with no issues.

Ideally I am in need of a simple script to click an object to play my video full screen and pause/resume my looping audio track while the video is playing.

Thanks for your help,

Jeff

Video problems

December 17, 2012 - 7:25am #11

Hi negrelja

A few questions if you don't mind to help narrow things down a bit:

  • Are you using Unity pro?
  • Are you using the latest Unity 4.0.0f7
  • Are you on iOS?  if so which platform and which XCode version?
  • Have you tried substituting your video in place of the stock video within the videoplayback sample?
  • Does playing the video within a texture work?

thanks

N

 

 

Fullscreen Video Issues

December 17, 2012 - 7:18am #10

I am experiencing the same issues as described by Saverio. I am using the Video Playback sample as a component in one of my projects and have modified the VideoPlaybackController.cs code per David Beard's suggestion mentioned earlier in the thread. Only thing unique to my project is that I have an animation and audio track looping in my scene prior to the interactive button for playing video is pressed. Perhaps there is a conflict with the video and other elements running at the same time? Any help would be greatly appreciated.

Thanks,

Jeff

Video Problem

December 16, 2012 - 10:37am #9

Hi SaverioARLP

I have seen this problem in Unity before but I thought it was fixed in the absolute latest Unity 4 release 4.0.0f7 which is what I assume you are using?  and I take it you are using Unity Pro right?

If PMs were working I would ask you to PM me with a link to your project so  I could test, but they are not yet :(  Apologies for this.

Does this happen with the video playback sample?  If so let me know how I can try to reproduce so I can look into it further.

thanks

Nalin

I'm experiencing this very

December 16, 2012 - 9:36am #8

I'm experiencing this very same problem: each time I let a video play to its end in full screen on iOS the app freeze on a blank screen. If I tap the screen just 1 sec before the video end the quicktime interface is shown and there I can see that it show a loading message that last forever, without beeing able to get back to my app.

All of my software components are up to date: Unity 4.0.0f, Vuforia 2.0.29 and Vuforia Sample VideoPlayback 2.0.6. My testing device is iPhone 4 with iOS 6.0.1.

I tested with videos both from the StreamingAsssets (double touch on the video to switch from texture mode to full screen) and from a website (m4v for download over http, no streaming).

Moreover, if I exit the app (home button) and launch it again, it does not reload but rather continues loading forever (so no crash occurred). I have to kill the app and launch it again (something users don't really know how to do, and is really annoing). In my opinion this is a serious problem, because it completely prevents from releasing an iOS app that show videos from the Internet or uses fullscreen videos. David, I'm available for testing if this can help.

Handheld.PlayFullScreenMovie Going black

December 11, 2012 - 2:44pm #7

Thank you David. I am now able to force the video to play fullscreen but noticed that if the video plays all the way through the screen turns black or the iOS media player displays a loading dialog indefinitely. Any ideas how to force the media player to close once the video has played out? It would also be ideal to kill or pause my looping audio track at the start of my video.

Thanks in advance!

Handheld.PlayFullScreenMovie Going black

November 26, 2012 - 6:37pm #6

 

What you need to do is to catch the cases where a device x OS combination is capable of playing the video on texture, and force these to full-screen.

// Handle single tap event

    private void HandleTap()

    {

        // Find out which video was tapped, if any

        VideoPlaybackBehaviour video = PickVideo(mTouchStartPos);

 

        if (video != null)

        {

            if (video.VideoPlayer.IsPlayableOnTexture())

            {

                // This video is playable on a texture, toggle playing/paused

 

                VideoPlayerHelper.MediaState state = video.VideoPlayer.GetStatus();

                if (state == VideoPlayerHelper.MediaState.PAUSED ||

                    state == VideoPlayerHelper.MediaState.READY ||

                    state == VideoPlayerHelper.MediaState.STOPPED)

                {

                    // Pause other videos before playing this one

                    PauseOtherVideos(video);

 

                    // Play this video on texture where it left off

                    // video.VideoPlayer.Play(false, video.VideoPlayer.GetCurrentPosition());

                    // NEVER!!

                    video.VideoPlayer.Play(true, video.VideoPlayer.GetCurrentPosition());

                }

                else if (state == VideoPlayerHelper.MediaState.REACHED_END)

                {

                    // Pause other videos before playing this one

                    PauseOtherVideos(video);

 

                    // Play this video from the beginning

                    // video.VideoPlayer.Play(false, 0);

                    

                        video.VideoPlayer( true, 0 );

                }

                else if (state == VideoPlayerHelper.MediaState.PLAYING)

                {

                    // Video is already playing, pause it

                    video.VideoPlayer.Pause();

                }

            }

            else

            {

                // This video cannot be played on a texture, play it full screen

                video.VideoPlayer.Play(true, 0);

                mWentToFullScreen = true;

            }

        }

    }

 

 

    // Handle double tap event

    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);

 

                // Play the video full screen

                video.VideoPlayer.Play(true, 0);

                mWentToFullScreen = true;

            }

        }

    }

 

I'd recommend keeping the VideoPlayerController and simply modifying it, as it provides useful state handling to control the response of Video instances to interactions, and manage multiple instances. 

Handheld.PlayFullScreenMovie Going black

November 26, 2012 - 2:23pm #5

The line that you are referring to is part of the "else" statement of the HandleTap() and by default is written as follows:

else
            {
                // Display the busy icon
                video.ShowBusyIcon();
               
                // This video cannot be played on a texture, play it full screen
                video.VideoPlayer.Play(true, 0);
                mWentToFullScreen = true;
            }

I am in need of a simplified version of the VideoPlaybackController.cs that does not include any of the Video Texture script.

Any help would be much appreciated!

Handheld.PlayFullScreenMovie Going black

November 21, 2012 - 2:33pm #4

You can set the Video instance to always go to full screen on the button press by revising line 147 in VideoPlaybackController.cs 

to..

video.VideoPlayer.Play(*true*, video.VideoPlayer.GetCurrentPosition())

The first argument is a boolean indicating whether the player should launch in fullscreen. 

Handheld.PlayFullScreenMovie Going black

November 21, 2012 - 6:49am #3

The examples in the Video Playback sample appear to be overlayed and play on an image target. Is there an example of playing a full screen video as I am trying to do on a button press? My game object button is receiving the OnMouseDown event in Unity but no video is playing at all, I assume this is because I am targeting the video to play on a device. All of my devices are on iOS6 and am really hoping that there is a solution to avoid having to downgrade all of my software. Undecided

 

Handheld.PlayFullScreenMovie Going black

November 21, 2012 - 3:26am #2

Hi go2mktg,

Could you try playing the video within a straight Unity project to determine whether Vuforia has anything to do with it not being played?

Another thing you could try is taking the Video Playback sample and compiling /running it 1) with the standard videos, 2) with your own video

The next thing you could try is building it on XCode 4.4.1 with iOS5 as there have been a few issues there.

https://ar.qualcomm.at/content/lauch-movie-form-touching-object

Please let me know what you find.

 

N

Log in or register to post comments