Hello people,
I am able to play a video on Plane but unfortunately the autoplay and loop function does not work. How do I make sure that the video starts playing once the page loads and the video should play again once it ends?
Another issue is, I am playing the video on a plane but the video seems to be mirrored, as in flipped. What am I doing wrong in my script?
var ANote0 = BABYLON.MeshBuilder.CreateBox("ANote0", { width: 140, height: 90, depth: 0.100000 }, scene);
ANote0.position = new BABYLON.Vector3(180, 30, -425);
var axis = new BABYLON.Vector3(0, 1, 0);
var angle = Math.PI / 8;
var quaternion = new BABYLON.Quaternion.RotationAxis(axis, angle);
ANote0.rotationQuaternion = quaternion;
var mat = new BABYLON.StandardMaterial("ANote0Mat", scene);
mat.diffuseColor = new BABYLON.Color4(0, 0, 0, 1);
ANote0.material = mat;
var planeOpts = {
height: 90,
width: 140,
sideOrientation: BABYLON.Mesh.BACKSIDE
};
var ANote0Video = BABYLON.MeshBuilder.CreatePlane("plane", planeOpts, scene);
var vidPos = (new BABYLON.Vector3(0, 0, 0.1)).addInPlace(ANote0.position);
ANote0Video.position = vidPos;
ANote0Video.rotationQuaternion = quaternion;
var ANote0VideoMat = new BABYLON.StandardMaterial("m", scene);
var ANote0VideoVidTex = new BABYLON.VideoTexture("vidtex", "videos/screencast.mp4", scene);
ANote0VideoMat.diffuseTexture = ANote0VideoVidTex;
ANote0VideoMat.roughness = 1;
ANote0VideoMat.emissiveColor = new BABYLON.Color3.White();
ANote0Video.material = ANote0VideoMat;
ANote0VideoVidTex.video.play();
scene.onPointerUp = function ()
{
{
ANote0VideoVidTex.video.play();
}
}