contact@zeanex.com
+92 (317) 4843 022
Get a Quote
  • Home
  • Company
  • Products
  • Services
    • Marker based AR
    • Cloud based AR
  • Help & Support
    • Contact Us
    • FAQ
  • Blog

No products in the cart.

  • Home
  • Company
  • Products
  • Services
    • Marker based AR
    • Cloud based AR
  • Help & Support
    • Contact Us
    • FAQ
  • Blog

No products in the cart.

  • Home
  • Company
  • Products
  • Services
    • Marker based AR
    • Cloud based AR
  • Help & Support
    • Contact Us
    • FAQ
  • Blog

No products in the cart.

  • Home
  • Company
  • Products
  • Services
    • Marker based AR
    • Cloud based AR
  • Help & Support
    • Contact Us
    • FAQ
  • Blog
Blog
Home Tutorials Display Video on an image target using VUFORIA in unity 3d
Tutorials

Display Video on an image target using VUFORIA in unity 3d

CEO October 2, 2019 0 Comments

Augmented Reality leads us to the combined path of digital and the virtual world. In this tutorial you will learn to Display Video on an image target. The video below will help you for better understanding of this blog.

Unisex fitness and bodybuilding wiggle.com swimming magnum clen 40 bodybuilding room in matoury, professional high school de balata – (guyana).
Augmented Reality : how to Display Video on an image target or marker using vuforia in unity 3d

For better understanding make sure to read the previous blogs i.e. DISPLAY 3D MODEL ON IMAGE TARGET USING VUFORIA IN UNITY3D and DISPLAY IMAGE ON AN IMAGE TARGET OR MARKER USING VUFORIA .

Create a new unity project:

In augmented reality creating a new unity project requires some of the things to be done. For creating a new unity project you need to write project name and then click on create project.

creating new database in unity

Adding new image:

For adding a new image target you need to go to vuforia engine. After going to vuforia engine click on image and re position it. Now go to vuforia portal. For opening vuforia developer portal make sure that you are sign in. Click on develop and after that go to click on target manager. For adding the target click on single image. Now choose the image by clicking on the browse button, then add certain width and rename it. Then click on add.

Adding image in vuforia

Scene Setting:

Now we have to set scene for augmented reality. For that you have to delete main camera and add AR camera and image. As you can see this warning sign, go to build settings then go to player settings. Go to the bottom click on XR settings and check the vuforia augmented reality.

Warning sign during scene setting

Downloading the database:

Now download that data base. Click on unity editor then click on download. When it is downloaded drag it to the unity timeline put it in assets. Make sure that all the items are selected and click on import. Go to image target and select your database. Now you can see your image has loaded.

Downloading the database and dragging it to unity

Display video on an image target:

So, we will go to our target then click on 3D object and move to plane. After clicking on plane resize it to fit on image target.

Adding video player:

Our next step is to add video player on this plane object. We need to go to add component then click on it and after clicking on it type video player on it. then go to video player by clicking on it. Lets import a video clip, now for importing video clip drag video clip into the unity. After dragging click on plane and then go to video player. Drag the video into the video player. Now unchecked the play on awake. We don’t want to play the video as play on awake because we want to play it only when the target image is visible through camera. If you want to make the video loop you can select loop other wise unchecked loop. In case of loop its totally your choice whether you select loop or does not select loop it doesn’t matter.

Adding video player into image target

Scanning the image target:

Now the thing is when we will scan the image target video will start playing but when the target is lost video will not stop. Video will continue playing in the background. Thus, we will continue listening to the sounds of the video. So, in order to avoid that we need to code few lines. So, go to create and click on C# script and name it as track able event handler. Open this file by double clicking on it.

Coding of track able event handler:

The code of this track able event handler file is totally same as to the default track able event handler file that is attached to our image target. We will open this file. We only have to do few minor changing in code. Press Ctrl A and then Ctrl C and paste it to the track able event handler file.

Now in the track able event handler file delete the default placed code and press Ctrl V to paste the default track able event handler code in this file. Coding of track able event handler:heck the name of the file which is track able event handler file and give the same name to the class.

Adding unity engine event:

So, basically what we have to change in this file is that we are going to add unity engine event. So, we will be using codes as:

using Unity Engine. Events;

Declaring public variables:

We need to declare two public variables onTrack and onLost.

public UnityEvent onTrack;

public UnityEvent onLost;

Unity events
Declaring unity events

The event onTrack needs to be called when tracking is found. So, here we will write

onTrack.Invoke();

The second unity event onLost needs to be called when tracker is lost. So, here we will write

onLost.Invoke();

Play, stop and pause video:

Save the file. Now attach this code to the image target and delete the default attached component. After that you will see the two events which are the public events that we have initialized onTrack and onLost. Click on the + icon in onTrack event. Now drop the plane game object. Click on the function and go to video player and select Play() as we want to play video when target is found. No drop the plane game object. Click on the function and go to video player and select Pause() or Stop(). As we want to pause or stop video when target is lost.

Adding video in unity

Export Application:

From top menu click on file, then click on build settings. Check the platform is android if not switch it. And then click on add open scenes. Now click on player settings. Go to other settings. Change the package name according to your choice. Unchecked x86 and Android TV compatibility. Change the stripping level to low. Click on XR settings and make sure vuforia augmented reality is selected. And then you can insert the icon of your app. That’s all for settings now connect your android mobile with your computer and click on build and run. Now name it and save it.

Augmented reality display video on an image target unity3d video vuforia
1
2059 Views
AboutSundas Fatima
Display 3d model on image target using vuforia in unity3dPrevDisplay 3d model on image target using vuforia in unity3dSeptember 28, 2019
play audio on an image target using vuforia in unity 3dOctober 9, 2019play audio on an image target  using vuforia in unity 3dNext

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts
  • Augmented Reality in Ecommerce and Retail
  • Create AR for the travel and tourism industry
  • Create augmented reality experience for restaurants
  • How to install Location Based ar APP With admin panel
  • Vuforia web services api: how to add target in vuforia cloud database?
Recent Comments
  • Valéria Gomes on MarkerLess Web AR with Admin Panel
  • Greg K on Vuforia Cloud Recognition App with Web Panel
  • Mohammad on Vuforia Cloud Recognition App with Web Panel
  • Ali Hamza on Vuforia Cloud Recognition App with Web Panel
  • Ahmet on Vuforia Cloud Recognition App with Web Panel
Archives
  • September 2022
  • January 2021
  • April 2020
  • March 2020
  • February 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
Categories
  • AR Creato
Meta
  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Categories
  • AR Creato 3
Recent Posts
No posts were found for display
Tags
AR AR Creato arcreato AR Creator AR Editor areditor Augmented reality augmented reality in ecommerce augmented reality in restaurants Augmented Reality in Retail menu AR tourism AR travel AR

We are here to transform your ideas into reality. We can build AR applications for business, artists, education etc with custom requirements.
Services
Marker Based AR
Cloud Based AR
Contacts
Email:
contact@zeanex.com
Phone:
+92 (317) 4843 022

Newsletter

Terms of use | Privacy Policy

Copyright © 2020 Zeanex Techonologies (SMC-PVT) Limited. All Rights Reserved.