I am sending you a video file by email. @jan
- I want to play the video when I arrive at the view when the video is turned off.
- Conversely, when the movie is turned on, the video stops after moving the view through the code. However, after you turn off the movie, it is not played through the trigger button either.
viewer.onViewSwitchDone(function (viewName) {
var videoTexture = viewer.findMaterial("Painting 03").baseColorTexture;
videoTexture.video.addEventListener("ended", function () {
viewer.switchToView("p2");
});
if (viewName === "p2" && videoTexture.isPlaying === true) {
videoTexture.video.pause();
} else {
videoTexture.video.play();
}
return true;
});