Skip to main content
1-Visitor
December 6, 2021
Solved

Playing a video after QR-Code Scan

  • December 6, 2021
  • 2 replies
  • 4497 views

Hey Guys! 

 

I am facing another problem. I want to scan different QR-Codes with the Hololens 2. Depending on which QR-Code is scanned I want to make videos visible in order to build up a learning platform with Vuforia Studio. 

 

I guess I need a Java Script code to do so as the scanning function is not able to to it directly.

 

Can anybody help me with that? I am really struggling with the Code or to find a solution.

 

Thank you in advance!

 

Marius 

Best answer by sebben

Hi,

yes, if you have more 3D Video Panels you don't have to change the source.

You can change the visibility instead: 

 $scope.view.wdg["3DVideo-x"].visible = true;

But I'm not sure if I get your use case. The User could just go around and watch all the videos. Why do you need the scanning?

And how do you position the videos on the parts, what  target are you going to use?

2 replies

24-Ruby III
December 6, 2021

Some related useful topics:

14-Alexandrite
December 6, 2021

Hi,

if you can choose the QR-codes freely, you can just bind the scanned value property to the video source property.

Then generate QR-codes with the path to the video source, for example : app/resources/Uploaded/video1.mp4

 

If not, you need a function like this and execute it from the value acquired event for the scan widget.

$scope.changeVideo = function(){

 if($scope.view.wdg["scan-1"].scannedValue == "QR-Code1-URL"){
 $scope.view.wdg["3DVideo-1"].src="app/resources/Uploaded/video1.mp4";
 }
 
 else if($scope.view.wdg["scan-1"].scannedValue == "QR-Code2-URL"){
 $scope.view.wdg["3DVideo-1"].src="app/resources/Uploaded/video2.mp4";
 }
}

 

1-Visitor
December 7, 2021

Thank you for the hints! I have different QR-Codes for different videos. Each Video is positioned in a different Location in my 3D Container. For Example there is a video for how to repair parts of the High Bay Warehouse & a Video for repairing the motor of a Vacuum gripper arm. The videos are positioned next to the parts itself. So I have to call a specific 3D Video with the scan of a QR Code. At the moment I can chose the freely. 

 

The source is a youtube video as a test & the source is already assigned to the 3D-Video Widget. Can I then let the 

.src="app/resources/Uploaded/video1.mp4";

out?

 

Or how do I have to change this in order to make it work with my circumstances?

 if($scope.view.wdg["scan-1"].scannedValue == "QR-Code1-URL"){
 $scope.view.wdg["3DVideo-1"].src="app/resources/Uploaded/video1.mp4";

 

Sorry for the maybe stupid question. I am not an expert in Java Script. 

 

Thank you,

Marius 

sebben14-AlexandriteAnswer
14-Alexandrite
December 7, 2021

Hi,

yes, if you have more 3D Video Panels you don't have to change the source.

You can change the visibility instead: 

 $scope.view.wdg["3DVideo-x"].visible = true;

But I'm not sure if I get your use case. The User could just go around and watch all the videos. Why do you need the scanning?

And how do you position the videos on the parts, what  target are you going to use?