Issue for starting 3D Video from JS
Hi all,
I am currently developing a step-by-step instruction for HoloLens 2 that should play a video when the next step is triggered. For this, I have written some JS code that switches the step (containing animations and switch in the step description). The issue that is comming up when I run the code below is that the status of the video is constantly switching from play to pause and backwards.
A minimal snippet of the code I use:
getCurrentTitleLookUp = function (stepNumber) {
//initialize variables
switch (stepNumber) {
case 1:
//Changing labels and instructions
//Setting the video source
$scope.setWidgetProp("3DVideo-1", "src", "app/resources/Uploaded/Videos/Step-1.mp4");
//Play the video
twx.app.fn.triggerWidgetService("3DVideo-1", "play");
//play animations
break;
//goes on for all steps.
}
//That method is called on a button-click.
$scope.app.nextStep = function () {
stepNumber = stepNumber + 1;
getCurrentTitleLookUp(stepNumber);
// here is some logic for assemby
}
The following output gives me the log constantly:
3DVideo-1 userpick play button video3D-ng.js:150
pause 3DVideo-1 video3D-ng.js:218
3DVideo-1 userpick play button video3D-ng.js:139
play 3DVideo-1 video3D-ng.js:206
3DVideo-1 userpick play buttonvideo3D-ng.js:150
I used the following snipped for replaying the video, also on a button-click. There it works perfectly.
twx.app.fn.triggerWidgetService("3DVideo-1", "play");
Does anybody have an idea what I am doing wrong? I ran out of ideas, especially because it's working with the replay, but I am not sure what I am doing differently.
Thanks in advance!
Marius

