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

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");
videoMaterial.play();
videoMaterial.pause();
videoMaterial.isPlaying;