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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Getting Videos from Thingworx into Vuforia Studio

Jamal8548
12-Amethyst

Getting Videos from Thingworx into Vuforia Studio

Hello Community,

      I can say that it seems possible to get the videos saved which are saved in thingworx repository and show in vuforia studio on the video widget. There are 10 videos which i change with the click of a button. What do you think is a best solution that should i get the video on click everytime or first fetch all the videos together and then show it one by one with the button click. i mean store them as an array. Any suggestions in this regard...

 

Problem

 

 

let videos = [
    { id: 'video-2', src: 'app/resources/Uploaded/Illustration-1.mp4' },//1
    { id: 'video-2', src: 'app/resources/Uploaded/Illustration-2.mp4' },//2
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-3.mp4' },//3
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-5.mp4' },//4  
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-6.mp4' },//5
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-7.mp4' },//6
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-8.mp4' },//7
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-9.mp4' },//8 
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-10.mp4' },//9  
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-11.mp4' },//10 
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-13.mp4' },//11 
  	{ id: 'video-2', src: 'app/resources/Uploaded/Illustration-14.mp4' },//12 
];	

 

I have many experiences with different videos with different business logics and thats why i want to fetch videos dynamically from the back end. I have found the service below as you can see to get the binary data of the video but now even one clip which is of 35MB is taking 15 seconds to fetch from filerepository. any idea to make it fast or any other approach should i  have to consider here?

 

Jamal8548_0-1725274701515.png

 

@RolandRaytchev  any suggestions here?

 

2 REPLIES 2

With LoadBinary service we can access videos/pvz files or anything... 

 

 $scope.serviceName='LoadBinary'
  $scope.repositoryThing='V2.FileRepository'


  //var parameters   =  {"path":"ML1/0011/1715682357732/1/03683147-Animation.pvz"} 
   var parameters   =  {"path":"ML1/0011/1715682357732/1/30122501_animation_matritze.pvz"} 
  
  // var parameters   =  {"path":"ML1/0011/1715682357732/1/20231205_Q-Gate_SVL_Stator_Med.pvz"}  ;  console.warn(parameters)
  twx.app.fn.triggerDataService($scope.repositoryThing,$scope.serviceName,JSON.parse(JSON.stringify( parameters)));
  $scope.$applyAsync();    
  
  console.log("after callLoadBinaryContent wdgName:"+$scope.wdgName)




$scope.$root.$on('LoadBinary-complete', function(event, args) { 
  console.log("LoadBinary-complete event");console.log("name="+event.name)
  console.warn(args.data[0].Content)
  
  
  
  let converted_file= 'data:video/mp4;base64,'+args.data[0].Content
  console.warn(converted_file)

 

Hi @Jamal8548,


Thank you for your question!

Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Also, feel free to add any additional information you think might be relevant. 

 

Thanks for using the Community!

 

Best regards,

Catalina
PTC Community Moderator
Announcements
Top Tags