Log in or register to post comments

VideoPlayback Error - Video End

March 15, 2013 - 12:20am #1

Hi there,

I am currently using Unity 4.0.0f7 and Vuforia-unity-android-ios-2-0-31. I tried the VideoPlayback-2-0-7 in ios 6 but at the end of the video, the player stops and says he is loading. He doesn't come back in the application. It works well for is I push "Done".

Another strange thing is that I don't get the player status. I just Get Ready or Playing there is no handle for Stopped, reachedEnd etc...

Does somebody have any idea about that ?

Thanks a lot for your help !

Regards.

VideoPlayback Error - Video End

May 8, 2013 - 6:46am #13

For others facing the same problem and seeking a solution

 

The best/easiest/most uniform alteration that I have found for this is documented there

 

https://developer.vuforia.com/forum/general-discussion/vuforia-video-playback-fullscreen-ios

 

and consist of a small alteration within VideoPlayerHelper.cs at line 220 to force Handheld.PlayFullScreenMovie for iOS (and not only Android) - keeping out of the faulty iOS6.0 end of movie problem.

It then behaves same as on Android (plays portrait if your app is portrait mode) and you can prohibit the "full control" if you need to.

VideoPlayback Error - Video End

May 8, 2013 - 12:40am #12

Not at the moment, so you need to find a workaround such as the one below.

We are aware of the issue and it may be fixed in a future release.

 

N

VideoPlayback Error - Video End

May 7, 2013 - 1:23pm #11

Was there ever a permanent solution for this with IOS 6 and iPhone 4S?

VideoPlayback Error - Video End

March 18, 2013 - 2:32pm #10

I believe I may have found the underlying problem...

Pre-iOS6, when a video finished playing it would fire an event:

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:player];

Which the Vuforia-VideoPlayback sample app uses to dismiss the video after its finished and allows it to return focus to Unity.

On iOS6 and above, they recommend calling:

UIMoviePlayerControllerWillExitFullscreenNotification

I cannot replicate the issue on any device that is not running iOS6.  Soon as I run the app on iOS6+ devices, everything works except the dismissal of the full screen video player because it is relying on a deprecated callback.

Is it possible to get an updated sample app that corrects this issue to include the iOS6+ new naming convention for the "video finished" callback?

Thanks in advance!

VideoPlayback Error - Video End

March 18, 2013 - 12:04pm #9

Thanks NalinS.

Seems my fix worked for all devices except my iPhone4S running iOS6.0.

The same solution that works for iPad2/3 doesn't work for iPhone4S.  The iPad2 is 6.0 and the iPad3 is 5.1 and theres not a problem returning from fullscreen playback, but on iPhone4S iOS 6.0 the video finishes and just goes black and never dismisses.  The app isnt crashing because i can still see my debugs and code executions in debugger while the video playback screen just stays black...

VideoPlayback Error - Video End

March 18, 2013 - 11:50am #8

I'd preferably like to just disable the controls during video playback because my client wants the video to play fully through without user interruption.  

Is this possible using the sample app's functionality?  

Hard to say as this is not a use-case we test for.

 

Do I need to modify something in XCode to tell the movie player to always open with the player controls hidden?

The iOS movie player uses the standard video player that comes with iOS, so theoretically if this supports the additional functionality then it ought to be possible.  However it might be that we do not expose such functionality at the moment.

...so if you can find a way this could work and it might help other developers overcome similar issues you could make a feature request in the wish list and I will try to progress - but no promises :)

HTH

N

 

 

 

VideoPlayback Error - Video End

March 18, 2013 - 9:01am #7
  • Unity 3.5.7f6
  • Latest iOS6
  • Fullscreen video
  • Vuforia Video Playback library

Yes that's the solution that worked for me.

If you pause the app, it will still load the next scene in Unity, but keeps the video player focused until the user hits done manually.  

There are plenty of people asking questions about it on the forums, but as usual the people with the solutions find them and keep 'em secret!

I'd preferably like to just disable the controls during video playback because my client wants the video to play fully through without user interruption.  Is this possible using the sample app's functionality?  Do I need to modify something in XCode to tell the movie player to always open with the player controls hidden?

 

Vince

VideoPlayback Error - Video End

March 18, 2013 - 8:47am #6

Great to hear Vince.

Ok, just a few questions so it might help a few others here :)

  • This is Unity 4 / 4.1 right?
  • Latest iOS6 ? (they all seem a bit different)
  • Full screen video right?
  • Are you using the Vuforia Video Playback library in iOS or the Unity Handheld.PlayFullScreenMovie (Pro only)

...and your solution is

I have a yield WaitForSeconds that is the length of my video as a delay before calling other code, so I just padded the value to add a couple extra milliseconds for the player to wrap up its playback and allow Unity to return to focus as expected.

What happens if the user pauses the video during fullscreen playback?

BTW Is there anything on the Unity forums about this issue?

 

cheers

N

 

 

VideoPlayback Error - Video End

March 18, 2013 - 8:35am #5

Hey NalinS,

So I hammered on this issue until 3AM last night and I was able to correct it.  Seemed that I wasn't waiting long enough after the video stopped before calling the next chunk of code, so while the code was executing and loading my next scene correctly, it never had a chance in the previous scene to tell Unity it finished playing and return focus to the Unity player.  I have a yield WaitForSeconds that is the length of my video as a delay before calling other code, so I just padded the value to add a couple extra milliseconds for the player to wrap up its playback and allow Unity to return to focus as expected.  

Was probably half my fault for coding late at night and the other half a script execution/timing thing that I wasn't considering when troubleshooting the real problem.

Thanks for your help!

Vince

VideoPlayback Error - Video End

March 18, 2013 - 2:18am #4

I am not sure this is a Vuforia issue, though I have seen it over the past few months and there does seem to be something about the Unity version that affects this.

Could you please try this as a simple Unity project that plays a video without any Vuforia and see if it recurs?

The iOS player that comes as part of the video playback sample has its own video player, so one thing you could do is switch between the two i.e. try the one that comes with Unity to see if that exhibits the same behaviour.

Let me know if you make any progress here.

cheers,

N

 

VideoPlayback Error - Video End

March 17, 2013 - 11:55pm #3

Is there a way to automatically close the iOS video player window when the video reaches the end?  I've tried reacting to the various VideoPlayer.MediaStates and I can successfully load scenes and perform other tasks when these states change, however I cannot seem to find a way to dismiss the video player window so that the Unity scene will be shown again.

If i manually press "done" on the window, it behaves as expected.  Is there a callback I'm overlooking?
Would it be possible change the parameters of the MPMoviePlayerController that QCAR calls?

Unity 3.5.7f6, XCode 4.5.2, Vuforia 2.x+ SDK

VideoPlayback Error - Video End

March 15, 2013 - 3:51am #2

Have you tried the latest version of Unity 4.1 ?

thanks

N

Log in or register to post comments