Skip to main content
1-Visitor
March 3, 2021
Solved

Navigate view after all steps finished playing

  • March 3, 2021
  • 1 reply
  • 2665 views

Hi,

 

I have multiple views in a project. 

How to automatically navigate to second view after steps in first view end. I'm using Hololens 2
 
Thank you. 
Best answer by sebben

That should not be possible unless you also kept the first solution. ( But it should wait until the step is completed anyway)

 

To rewind a step just add a button and connect the click event with the rewind service of the model.

 

If you want to make sure the last step is finished before the user can change the view you can change condition of the if statement:

if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps && $scope.view.wdg["model-1"].playing == false)

 

If it still does not work can you please share an example how you are trying to do it. Thanks.

 

1 reply

14-Alexandrite
March 3, 2021

Hi,

you can use this function:

 

$scope.$on('stepcompleted', function(evt, arg1, arg2, arg3) { 
if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps){
 $scope.navigate("View2");
	}
}); 

 

Make sure you change the model and view name according to your experience.

KM_011-VisitorAuthor
1-Visitor
March 4, 2021

Hi, thank you for your response.

 

i've tried it, and it works. 

 

But i've concern regarding swipe left gesture. Is it possible to navigate view if the last step has finished playing without user clicking on rewind button and then user swipe left?  

14-Alexandrite
March 4, 2021

You can use the swipe left gesture. You need to write a function like this:

$scope.navigateToView = function() { 
if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps){
 $scope.navigate("View2");
	}
}

 

Next, click the JS icon next to the swipeleft application event, and enter the following in the expression box: viewCtrl.navigateToView();