Log in or register to post comments

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 1, 2012 - 5:41am #1

Hello,

I found a problem after calling Handheld.PlayFullScreenMovie the screen will stay black for a long time before it return to camera again.
It only happened with IOS.

on the log there are some message:

- UIView has CAEAGLLayer class

- UIView does not respond to selector renderFrameQCAR

 

My problem just the same with this
http://forum.unity3d.com/threads/143266-quot-Handheld.PlayFullScreenMovie-quot-not-unloading-movie-after-complete

they said the problem is come from ARCamera.

Thank you.

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 21, 2012 - 8:38am #18

Can you PM me?

If you can let me have a project I would be happy to take a look at this for you.

N

EDIT

Actually could you just try one thing. When specifying the file name could you remove the following three characters from the filename

 "://"

and see if it makes a difference?

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 21, 2012 - 8:18am #17

Removed "://" and the video won't play.

m_path value after removed: "file /var/..bla..bla.."
tried m_path = "/var/..bla..bla", "var/..bla..bla.." not working too.. 

btw.. I just send you PM for the project download url :)

Thank you.

EDIT

forgot to tell you.. it's in 'scene1' and 'MyScripts.cs'  

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 21, 2012 - 2:01am #16

I hard coded VideoPlayBackBehaviour.isPlayableOnTexture always return true, and try it on IOS. it is still play in fullscreen.

as it's still cannot play on texture I hard coded VideoPlayerHelper.IsPlayableOnTexture always return true.
try it.. but nothing happened on tapping the play icon,
it stop at "VideoPlayerHelper.videoPlayerPlayIOS(mVideoPlayerPtr, fullScreen, seekPosition)"

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 20, 2012 - 6:54am #15

Sorry - for some reason I was referring to the native code - my error :(

In Unity in VideoPlaybackBehaviour.cs line 178 is where it asks whether it can play on a texture:

                 isPlayableOnTexture = mVideoPlayer.IsPlayableOnTexture();

..which I think asks the underlying video player (iOS or Android) as to whether it is possible, though it could be that 

If you know the file will be local then you could try and set this to true and see if it works?

Let me know how you get on.

N

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 17, 2012 - 10:46am #14

VideoPlayerHelper.cs:

public bool IsPlayableOnTexture()

    {

//return videoPlayerIsPlayableOnTexture();

 

bool result = videoPlayerIsPlayableOnTexture();

Debug.Log("#DEBUG - IsPlayableOnTexture() result: " + result.ToString());

return result;

    }

 

 

    // Indicates whether the movie can be played fullscreen

    public bool IsPlayableFullscreen()

    {

//return videoPlayerIsPlayableFullscreen();

 

bool result = videoPlayerIsPlayableFullscreen();

Debug.Log("#DEBUG - videoPlayerIsPlayableFullscreen result: " + result.ToString());

return result;

    }

 
 
and the result:

#DEBUG - IsPlayableOnTexture() result: False

 

 

Could you give any hint on the tweak?
I see that the code going to this function 

[DllImport("__Internal")]

private static extern bool videoPlayerIsPlayableOnTextureIOS(IntPtr videoPlayerPtr);

 

 
 
 

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 17, 2012 - 9:01am #13

Hi aciang

It might be that the file is still being classed as Remote which means playing full screen.

Can you look from line 137 onwards in VideoHelper.m and check that the code is taking the correct branch?  If not then you might need to tweak it slightly.

Let me know how you get on.

N

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 17, 2012 - 7:54am #12

Hi NalinS,

I just tried using the path from the link you have given.
I downloaed the file to local '/var/mobile/Applications/86896CFB-.../Documents/movie.mp4'
set it to VideoPlayback m_path 'file://var/mobile/Applications/86896CFB-.../Documents/movie.mp4'

on IOS it still play it in full screen not on texture.

Please advise.

 

 

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 16, 2012 - 2:40am #11

Hi aciang,

Normally on iOS downloaded files typically go in the documents directory.

On native iOS this is accessed via the NSHomeDirectory() method.

I am nopt exactly sure what this is in Unity, but you might find this post useful:

http://answers.unity3d.com/questions/18647/unity-iphone-can-i-store-data-on-the-iphone-to-be.html

HTH

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 15, 2012 - 8:34am #10

DavidBeard wrote:

That is due to the underlying iOS media player. It won't allow us to play remote files on a texture. The only solution is to download them to the device and then load them as local files.

load them as local files? how to do that?
to where should I download the files? I've tried to download the file to Application.dataPath, Application.persistentDataPath, documents and load the video by changing the m_path to 'file://...' but none of them work in ios texture.

Please advise.

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 14, 2012 - 7:29pm #9

That is due to the underlying iOS media player. It won't allow us to play remote files on a texture. The only solution is to download them to the device and then load them as local files.

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 13, 2012 - 11:03pm #8

DavidBeard wrote:

You may not need to destroy the ARCamera. Try obtaining the QCARBehaviour (e.g. GetComponent<QCARBehavior>() ) and setting .enabled to false. You can then reset .enabled to true to restart the video background.

This is the first I've heard of this issue w/ PlayFullScreenMovie, so please report your results.

Also is there a reason that you don't want to use the Video Playback prefab for this?

Thank you David.

Sorry for late reply.. just having long vacation, can read the forum but cannot try.. Laughing
Thank you for the solution by setting the enabled to false and set it back to true, it works better.. but not perfectly solved as sometimes it took some times to back to camera.

VideoPlayback prefab, I don't know about this before.. thank you for mentioning it :)
Where can I get newsletter so I can always get updated with vuforia?

After trying VideoPlayback.. it is great but why it can't play network files in IOS?
addon MobileMovieTexture can play on network files.. but only can play ogg without sound.. :(

My solution for Handheld.PlayFullScreenMovie is by loadlevel to a new scene and playfullscreen then back again to recent scene.

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 3, 2012 - 2:40am #7

DavidBeard wrote:

You may not need to destroy the ARCamera. Try obtaining the QCARBehaviour (e.g. GetComponent<QCARBehavior>() ) and setting .enabled to false. You can then reset .enabled to true to restart the video background.

This is the first I've heard of this issue w/ PlayFullScreenMovie, so please report your results.

Also is there a reason that you don't want to use the Video Playback prefab for this?

I've checked this out and it is easy to reproduce. Just use Vuforia and play a movie i fullscreen using the Handheld functions. Screen will stay black afterwards. This even happens using the video prefab code and changing videoPlayerPlay(fullScreen, seekPosition); to use the Handheld function. So the only working thing is to use videoPlayerPlay(fullScreen, seekPosition);, however it gives no control over UI elements of the video player. I would like to use CancelOnTouch.

Also disabling QCARBehaviour does not work. Still get the same messages and black screen:

2012-08-03 11:37:30.377 arapp[5331:707] DEBUG/AR(5331) UIView has CAEAGLLayer class
2012-08-03 11:37:30.382 arapp[5331:707] DEBUG/AR(5331) UIView does not respond to selector renderFrameQCAR
2012-08-03 11:37:30.384 arapp[5331:707] DEBUG/AR(5331) Could not find a UIView with CAEAGLLayer layer class that responds to selector renderFrameQCAR
2012-08-03 11:37:30.404 arapp[5331:707] DEBUG/AR(5331) UIView has CAEAGLLayer class
2012-08-03 11:37:30.406 arapp[5331:707] DEBUG/AR(5331) UIView does not respond to selector renderFrameQCAR
2012-08-03 11:37:30.410 arapp[5331:707] DEBUG/AR(5331) Could not find a UIView with CAEAGLLayer layer class that responds to selector renderFrameQCAR
2012-08-03 11:37:30.415 arapp[5331:707] DEBUG/AR(5331) UIView has CAEAGLLayer class
2012-08-03 11:37:30.417 arapp[5331:707] DEBUG/AR(5331) UIView does not respond to selector renderFrameQCAR
2012-08-03 11:37:30.419 arapp[5331:707] DEBUG/AR(5331) Could not find a UIView with CAEAGLLayer layer class that responds to selector renderFrameQCAR

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 2, 2012 - 1:43pm #6

Yes, I'm trying but it is not completely clear to me. I'm trying to start a video clip in Unity's Start() method using a Video prefab but I can't seem to pick which video :P

EDIT: I sort of got it working. However for a brief second one can see the camera view and then the video starts which is not optimal. Doing it in Awake () crashes the app for obvious reasons. I could always fake a black screen but I just ask if there is any other smart way of doing this? Also I want the video controlls to be CancelOnInput. I can't seem to control this for iOS?

I really need som help with this as I don't know the ins and outs of how Vuforia is loaded. It seems to me there is some sort of race condition here. Usually it crashes sometimes it doesn't. If I keep the instructional screen it doesn't. If I remove it, crash... is it possible to do what I want?

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 2, 2012 - 12:26pm #5

Take a look at the VideoPlaybackHelper and VideoPlaybackBehaviour, also the TrackableEventHandler in the sample. These will show you how to play the video, control the player etc..

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 2, 2012 - 12:13pm #4

OK. My scenario is this: I want to play a full screen intro movie right after the splash screen. Using the Handheld functions directly obviously does not work very well with the ARCamera. So can I use the Video Playback prefab to make this work as it probably takes care of the ARCamera? I want to play in fullscreen. Note that this has nothing to do with markers. I want to play the video manually.

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 2, 2012 - 11:11am #3

I have the exact same problem. The screen stays black but audio plays fine.

What is "the video prefab"? I can't seem to find such a prefab. Any documentation?

EDIT: Found it but looking at the code it uses the same Unity functions for fullscreen video so no luck there...

EDIT2: Thing is, I use: Handheld.PlayFullScreenMovie("Intro_film.mp4", Color.black, FullScreenMovieControlMode.CancelOnInput, FullScreenMovieScalingMode.AspectFit);

which cancels the video clip when the screen is touched. If I touch the screen it dismisses the video and everything works fine. If I let the video clip finish by its own the black screen shows. Really odd this...

Going with FullScreenMovieControlMode.Full and showing the controls when the clip finishes shows that the whole UI freezes.

IOS Handheld.PlayFullScreenMovie stay black screen after played

August 1, 2012 - 7:11pm #2

You may not need to destroy the ARCamera. Try obtaining the QCARBehaviour (e.g. GetComponent<QCARBehavior>() ) and setting .enabled to false. You can then reset .enabled to true to restart the video background.

This is the first I've heard of this issue w/ PlayFullScreenMovie, so please report your results.

Also is there a reason that you don't want to use the Video Playback prefab for this?

Log in or register to post comments