Log in or register to post comments

Unity 5 + Vuforia 5.5 - Video Playback doesn't work for Android

May 18, 2016 - 12:37am #1

Hello Vuforia users,

 

I am currently working on an app, that gives additional information to historical photos. Therefore I want to implement videos, but the video won't play. 

I made 4 buttons on the left as a GUI and with every button you can show or hide elements (1. weather information, 2. news headlines, 3. multimedia elements: video/audio, 4. social media: tweets/reactions/trendings etc.). 

I've put the video prefab of the video playback asset into my image target and added the "play video" script to the AR Camera. Neither in unity's play mode, nor when I export the app to android, the video can be played. It does show the play button on the video, but if I tap on the button, nothing happens. 

 

I've tested this with the original video, as well as with my own video. Strangely this only appears in my app, the vuforia video playback sample scene works fine with the test video and with my own video.

 

So my questions are:

1. Do I need to implement more scripts to get the video prefab to play?

2. If not: can the GUI buttons be the problem, why I can't press the play button on the video?

 

Thanks in advance!

To make it clear, I've attached a mockup, I've did with photoshop to show you my layout and how I've arranged my app.

AttachmentSize
Image icon Samsung Galaxy S7 Edge - Silver4.jpg667.22 KB

Unity 5 + Vuforia 5.5 - Video Playback doesn't work for Android

May 20, 2016 - 5:02am #3

First of all thanks for your fast response :-)

 

In the "Vuforia-3-VideoPlayback" scene the AR Camera has the "Play Video" script embedded and the video prefabs have the "Video Playback Behaviour" script embedded. I did this as well and adapted the path of the Video Playback Behaviour script, added a keyframe texture and I removed the "Default Trackable Event Handler" script from the image target and added instead the "Trackable Event Handler" script.

In the sample scene, there isn't the "VideoPlayerHelper.cs" script embedded. Where do I have to place the script in order to enable the "picking" functionality? And do I need the "VideoPlaybackTapHandler.cs" script as well?

Unity 5 + Vuforia 5.5 - Video Playback doesn't work for Android

May 18, 2016 - 11:57am #2

"....Neither in unity's play mode, nor when I export the app to android, the video can be played. It does show the play button on the video, but if I tap on the button, nothing happens...."

You probably need to implement the "picking" functionality; check out the VideoPlayback sample app scripts (in particular the PlayVideo.cs, the VideoPlaybackBehaviour.cs and the VideoPlayerHelper.cs scripts), which contain code to perform ray-cast and picking and to start the video playback if a target is intersected.

Note that the VideoPlayback is a sample app feature, it is not a core component of the Vuforia SDK.

 

"...I've tested this with the original video, as well as with my own video. Strangely this only appears in my app, the vuforia video playback sample scene works fine with the test video and with my own video...."

This also confirms what I said above, check out the sample code and add the missing code to your project.

Log in or register to post comments