Log in or register to post comments

Several trackers with video playback

November 8, 2016 - 4:47pm #1

Hi I have a scene with 20 trackers and each one show 1 video when is tracked. The problem that I have is that only 16 videos (of the 16 trackers) are shown. It is not always the same trackers than only show the busy texture. It varies from build to build, but they are always 4 videos that dont shown. I scaled the videos because I thought that maybe the issue was the size, but I still have the same result. I am using the sample for video playback. What could be the problem?

Thanks.

Several trackers with video playback

November 11, 2016 - 4:06am #6

So which lines in the scripts is it that you have modified/added?

Will it also make the app play more videos? I got the same problem with the app refusing to show videos after a certain number.

Im trying to use the device database

Several trackers with video playback

November 10, 2016 - 8:42am #5

It seems that my fix was deleted... The general idea is under this post.

Several trackers with video playback

November 9, 2016 - 7:40pm #4

Finally, for be available to playback videos of a lot of trackers is necessary to make some modifications to VideoPlaybackBehaviour.cs and TrackableEventHandler.cs of the video playback sample. The modifications are in regions called MOD.

The files are attached.

I dont know if it would be better to only load and unload the videos instead of initialize and desinitialize them. And in ActivateAutoPlay maybe it would be better if the yield is shorter... I didn´t try.

Several trackers with video playback

November 9, 2016 - 4:27pm #3

This issue is related to this one.

DavidBeard wrote:

To support 30 videos, you'll need to load and unload them programmatically at runtime using the VideoPlayerHelper API, which is accessed using the VideoPlayer property of the video player instance. You also may need to store the videos remotely and stream them to your app via HTTP - if so, load them using their URL.

Take a look at the VideoPlayback sample's Trackable Event Handler script to see how the VideoPlayerHelper API is employed.

The video playback sample initializes and loads all videos when the scene starts; but for several trackers with video playback the videos have to be initialized or loaded when their trackers is found.

I will try to fix this and post it over here.

 

Several trackers with video playback

November 9, 2016 - 12:41pm #2

In Xcode I get the log for this four missing videos like this:

2016-11-09 14:31:37.371253 artedefutbol[2293:838837] Error - AVAssetReader not in reading state

	2016-11-09 14:31:37.371413 artedefutbol[2293:838837] Error - Unable to prepare media for playback

	VideoPlayer ready.

	<PrepareVideo>c__Iterator5:MoveNext()

	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

	

	(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)
2016-11-09 14:31:37.391196 artedefutbol[2293:838837] Video width not available in current state

	2016-11-09 14:31:37.391282 artedefutbol[2293:838837] Video height not available in current state

	InitVideoTexture with size: -1 x -1

	VideoPlaybackBehaviour:InitVideoTexture(Boolean)

	<PrepareVideo>c__Iterator5:MoveNext()

	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

	

	(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)
Texture has out of range width / height

	UnityEngine.Texture2D:.ctor(Int32, Int32, TextureFormat, Boolean)

	VideoPlaybackBehaviour:InitVideoTexture(Boolean)

	<PrepareVideo>c__Iterator5:MoveNext()

	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[ line 438]

	(Filename:  Line: 438)
UnityException: Failed to create texture because of invalid parameters.

	  at UnityEngine.Texture2D..ctor (Int32 width, Int32 height, TextureFormat format, Boolean mipmap) [0x00000] in <filename unknown>:0

	  at VideoPlaybackBehaviour.InitVideoTexture (Boolean isOpenGLRendering) [0x00000] in <filename unknown>:0

	  at VideoPlaybackBehaviour+<PrepareVideo>c__Iterator5.MoveNext () [0x00000] in <filename unknown>:0

	  at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0

	

	(Filename: currently not available on il2cpp Line: -1)
Log in or register to post comments