UPDATE: 10/22/19 - It works in Microsoft Edge, but not Chrome. So, it’s an issue with chrome (Version 77.0.3865.120 (Official Build) (64-bit)).
Bonus Info: It doesn’t work in Chrome Canary or the new Chromium-based Microsoft Edge (beta).
Buggy Expression: videoDome.videoTexture.video.currentTime = 5;
I am attempting to manipulate the underlying HTMLVideoElement (video) which belongs to videoDome.
However, when I attempt to adjust the video’s currentTime by assigning an integer to video.currentTime the result is always a currentTime of zero.
Note, the logic works in a playground, but not in my code.
Here are the relevant code snippets:
VideoDome Scene:
var createScene1 = function () {
var scene1 = new BABYLON.Scene(engine1);
var camera1 = new BABYLON.ArcRotateCamera("Camera", -Math.PI / 2, Math.PI / 2, 5,
BABYLON.Vector3.Zero(), scene1);
camera1.attachControl(canvas1, true);
videoDome1 = new BABYLON.VideoDome(
"videoDome",
["videos/sessionTest/output-BACK.mp4"],
{
poster: "images/XRiLoadScreen.jpg",
resolution: 32,
clickToPlay: false
},
scene1
);
return scene1;
};
RenderLoop:
engine1.runRenderLoop(function() {
scene1.render();
});
CurrentTime Assignment:
scene1.onPointerUp = function (){
videoDome1.videoTexture.video.currentTime = 2;
//videoDome2.videoTexture.video.currentTime = 3;
console.log(videoDome1.videoTexture.video.currentTime);
//console.log(videoDome2.videoTexture.video.currentTime);
};
Console Output:
Notice, the currentTime is being reset to zero and then being printed to the console whenever the onPointerUp() action is taken.
It seems that any attempt to adjust the video’s currentTime results in currentTime resetting to 0.
Working Playground Example: