I want to know how to control the video when the view movement is over

I am sending you a video file by email. @jan

  1. I want to play the video when I arrive at the view when the video is turned off.
  2. 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 () {
      if (viewName === "p2" && videoTexture.isPlaying === true) {
      } else {

      return true;

You need to control the playing and pausing of the video by higher level functions in the material. If you use play and pause on the video element the state becomes incorrect, instead use:

var videoMaterial = viewer.findMaterial("Painting 03");