Hey guys and welcome back
So this quick lecture, Im going to show you
how you can have video playback functionality in your Augmented Reality Apps
using Vuforia 8 and Unity 2020
Applications of this are, for an AR business card where you showcase your talents and skills
you can also use this for Educational AR Apps and for displaying video instructions
So the reason why we are redoing this video again, is because of a number of a number reasons.
In my last video I did not show you how to deploy to Android
Audio and video were separate
so I only showed how to display video without simultaneous audio playback
There was a lot of bugs in the video playscript
and you couldn’t play common video formats easily like .mp4
only .avi at the time
And lastly, that video is heavy outdated
I used Vuforia 6 in Unity 5.3
Its definitely time for a fresh updated tutorial on video playback
So Im really excited to tell you that this video will addresses all of the aforementioned issues
in Unity 2020
and the entire process has been revamped
So instead of taking you 15 minutes to get this functionality working
we will do it all in under 5 minutes. Saving you a lot of time and effort
So if there’s any other features or AR Application that you would like for me to cover
please comment down below
Before I get started with this Vuforia Tutorial
if you are interested in learning more about Augmented Reality
then I have 3 courses that you can check out
1.  Is the complete course on AR with Vuforia
the second is on integrating Augmented Reality with the Internet of Things
and the third course is my ARCore Master Class
If you are want to be an AR expert then check the links down below
Okay so lets get right into it!
Okay so we are going to continue from the last video
where we’ve managed to download, install Vuforia in Unity 2020
and export our Hello AR app to Android
If you have not done this is yet, I highly recommend that you check out the previous video first
especially if you are a beginner, before attempting this lecture for video playback in Unity
So first up, continuing from where we left off from the last lecture
We are going to create a new game object
in this case it will be a plane which will host our video screen
Lets resize it to the shape and size of our Target Marker
We can also manoeuvre it to be just above the marker as well
Now search for any video that you have lying around on your PC
Video Playback
I will select my demo video in .mp4 format
of my Project EDITH "Build Your Own AI Smart Glasses Course"
This one is Phase 4, where I showcased my AI voice assistant
Let's drag and drop this video back into Unity 3D and drag it onto your plane
Just ensure that your plane is a child of the Image Target, otherwise you will not see your plane
If you now click on your Plane Game Object
You will see that a video Player Script has automatically been instantiated
Over here you have some options for tweaking the rendition of the video in Augmented Reality
And it also includes Simultaneous Audio Playback which is really cool!
So over here you can select which video clip you want to use
Since we only have 1 video in our project, that is all that is shows
If you want for the video to play on the awakening of the app
in this case, we want would like for it to Play on Awake
Next we have Wait for first frame
which Determines whether the VideoPlayer will wait for the first frame to be loaded into the texture
before starting playback when VideoPlayer.playOnAwake is on
We will check this option as well
Loop is simple, Just says if you want to loop your video infinitely
This may be useful for an Augmented Reality business card. We’ll leave it unchecked for now
Skip on drop just instructs Whether the VideoPlayer is allowed to skip frames
Just to catch up with current time
We’ll check it, but we’ll hardly notice it unless your mobile phones processor is very slow
We can also set our video playback speed, depending on your preference
We’ll just set ours to 1
And then as mentioned earlier, we have our Audio to play simultaneously
Running the Demo
So now you can go ahead and test if your app is working
Our video is looking a bit obscured with the wrong dimensions but this can be easily fixed
We just need to adjust the dimensions of the plane and then rotate it again to fit the target marker
Click Play and all looks good so far
Android Deployment
Okay so now that we got it working, the only thing left to do is to export the app to Android
Lets go into build settings. Make sure that your scene is showing in the top left hand corner
and that you have Switch platform to Android
We did all this is the last lecture, so if you need to refer back to it
Select your device from Run Device. Mine is the LG H930 and then select Build and Run
When it prompts, we can type in the name of our app Which is Video Playback with Audio
And it should work just perfectly. Great!
hope it worked out for you and let me know down in the comments
what you would use video playback for
In my opinion, I feel that the detections works really well on Android rather than on PC
I wander but Im not sure if Vuforia is using the IMU on device to improve tracking of the markers
Anyways, Hope you enjoyed this video tutorial
thank you for watching and we’ll see you in the next lecture
if you are interested in learning more about Augmented Reality
then I have 3 courses that you can check out
1. Is the complete course on AR with Vuforia
the second course is on integrating Augmented Reality with the Internet of Things
and the third course is my ARCore Master Class
If you are want to be an AR expert then check the links down below
