cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to attach a Thingworx Repository file to the Hololens Project 3D Video widget

zZzzZ
6-Contributor

How to attach a Thingworx Repository file to the Hololens Project 3D Video widget

I want to link the file on Thingworx repository to the 3D Video widget of the Hololens project. What should I do?

ACCEPTED SOLUTION

Accepted Solutions

Hi @zZzzZ ,

 

For the mobile devices you have first to  test your experience in preview. If it doesn’t work in preview it won’t work in View. But unfortunately for the HoloLens2 that does not work so according to help for the 3D Video Widget

2024-11-06_18-17-18.jpg

So means that you need to test it on the device- HL2

Please use the credentials for the repository owner for all login forms (Studio, TWX, and View) to eliminate privileges related issues from your test.

So according to the developer team you’re not supposed to use any services for this.
Could you please try the instructions below?
You only need to follow the instructions for PVZ files, but with the media content instead of a PVZ file.
Create a File Repository in ThingWorx
Edit the Thing Template and Things
Update the Vuforia Studio Experience

 

So for example I have a field in the repository myVideo as link :2024-11-06_18-57-12.jpg

 

so above the usage of the myVideoFile TWX property /type==HyperLink/ which is added in Vuforia Studio to the External Data section.

That property is defined here in the Repository where the data is uploaded.

2024-11-06_18-40-02.jpg

 

 We can see that the value of the linkProperty has the syntax what is the output of the downloadLink field of the output /InfoTable/ of the GetFileListingWithLinks TWX service

Therefore I believe that you can use that syntax to set the resource property of the 3D video widget - e.g. some code like that :

 

 

 

 

 
 $scope.app.setThingWorxFile = (fullFilePath,widget,delay) => {
   $scope.view.wdg[widget].src=fullFilePath;
   $scope.$applyAsync();
   $timeout((w)=>{$scope.app.fn.triggerWidgetService(w,"play"); 
   },delay,false,widget)   
 }

 

 

 

and e.g. when you call for btn 1-4  for 4 different videos the e.g. functions:

 

 

 

//=============
 $scope.app.testTWX1=()=>{
 $scope.app.setThingWorxFile ('/Thingworx/FileRepositories/CADRepository1_test/FILES/VIDEOS/WayfinderBug.mp4','3DVideo-1',2000);}
 //=============
  $scope.app.testTWX2=()=>{
 $scope.app.setThingWorxFile ('/Thingworx/FileRepositories/CADRepository1_test/FILES/VIDEOS/ForBiggerJoyrides.mp4','3DVideo-1',2000);}
   //=============
   $scope.app.testTWX3=()=>{
 $scope.app.setThingWorxFile ('/Thingworx/FileRepositories/CADRepository1_test/FILES/VIDEOS/sonne1.mp4','3DVideo-1',2000);}
    //=============
    $scope.app.testTWX4=()=>{
 $scope.app.setThingWorxFile ('/Thingworx/FileRepositories/CADRepository1_test/FILES/VIDEOS/bluePump_issueModelTarget.mp4','3DVideo-1',2000);}
/************************************************************************************

 

 

 

I want to mention that that code will work only if the permissions for the access  of the repository thing are set correctly . Also the sample code is not really  perfect - it will try to start play with some delay after setting of the vidoe resource . ...But when the delay is not long enough  e.g. 2 seconds - so means in that time range the file is not loaded yet - then the play will be ignorred.

View solution in original post

2 REPLIES 2

Hi @zZzzZ ,

 

For the mobile devices you have first to  test your experience in preview. If it doesn’t work in preview it won’t work in View. But unfortunately for the HoloLens2 that does not work so according to help for the 3D Video Widget

2024-11-06_18-17-18.jpg

So means that you need to test it on the device- HL2

Please use the credentials for the repository owner for all login forms (Studio, TWX, and View) to eliminate privileges related issues from your test.

So according to the developer team you’re not supposed to use any services for this.
Could you please try the instructions below?
You only need to follow the instructions for PVZ files, but with the media content instead of a PVZ file.
Create a File Repository in ThingWorx
Edit the Thing Template and Things
Update the Vuforia Studio Experience

 

So for example I have a field in the repository myVideo as link :2024-11-06_18-57-12.jpg

 

so above the usage of the myVideoFile TWX property /type==HyperLink/ which is added in Vuforia Studio to the External Data section.

That property is defined here in the Repository where the data is uploaded.

2024-11-06_18-40-02.jpg

 

 We can see that the value of the linkProperty has the syntax what is the output of the downloadLink field of the output /InfoTable/ of the GetFileListingWithLinks TWX service

Therefore I believe that you can use that syntax to set the resource property of the 3D video widget - e.g. some code like that :

 

 

 

 

 
 $scope.app.setThingWorxFile = (fullFilePath,widget,delay) => {
   $scope.view.wdg[widget].src=fullFilePath;
   $scope.$applyAsync();
   $timeout((w)=>{$scope.app.fn.triggerWidgetService(w,"play"); 
   },delay,false,widget)   
 }

 

 

 

and e.g. when you call for btn 1-4  for 4 different videos the e.g. functions:

 

 

 

//=============
 $scope.app.testTWX1=()=>{
 $scope.app.setThingWorxFile ('/Thingworx/FileRepositories/CADRepository1_test/FILES/VIDEOS/WayfinderBug.mp4','3DVideo-1',2000);}
 //=============
  $scope.app.testTWX2=()=>{
 $scope.app.setThingWorxFile ('/Thingworx/FileRepositories/CADRepository1_test/FILES/VIDEOS/ForBiggerJoyrides.mp4','3DVideo-1',2000);}
   //=============
   $scope.app.testTWX3=()=>{
 $scope.app.setThingWorxFile ('/Thingworx/FileRepositories/CADRepository1_test/FILES/VIDEOS/sonne1.mp4','3DVideo-1',2000);}
    //=============
    $scope.app.testTWX4=()=>{
 $scope.app.setThingWorxFile ('/Thingworx/FileRepositories/CADRepository1_test/FILES/VIDEOS/bluePump_issueModelTarget.mp4','3DVideo-1',2000);}
/************************************************************************************

 

 

 

I want to mention that that code will work only if the permissions for the access  of the repository thing are set correctly . Also the sample code is not really  perfect - it will try to start play with some delay after setting of the vidoe resource . ...But when the delay is not long enough  e.g. 2 seconds - so means in that time range the file is not loaded yet - then the play will be ignorred.

additionally want to refer to PTC Vuforia Studio Help saying for Camer Widget https://support.ptc.com/help/vuforia/studio/en/#page/Studio_Help_Center%2FWidget3DCamera.html

f you want to save pictures to a repository in your ThingWorx instance, the following configuration parameter must be manually added to the configuration.json file by an administrator:
"nohttp2":true
If your Experience Service is installed on-premises, contact your administrator.
If your Experience Service is hosted by PTC, open a support case, select Vuforia Studio from the Product field, and then select Yes – Request an activity (refresh,build,access,upgrade etc) or information on PTC Cloud Environment from the Do you want to open a case with PTC Cloud Services? drop-down menu.

I believe  that this option will be helpful also for the video.  I tested the video display from TWX  as described in the previous post and it was working fine. There I saw that I also used that option on my Experience Servcie. Just wanted to mentioned it. Thanks

Announcements

Top Tags