Hello,
I am using video textures in BJS, and can certainly control their HTML5 video functions for play and pause, however, I need to control time such as adding ff and rewind. In HTML5 I would simply do the following:
<script type="text/javascript">
function vidplay() {
var video = document.getElementById("Video1");
var button = document.getElementById("play");
if (video.paused) {
video.play();
button.textContent = "||";
} else {
video.pause();
button.textContent = ">";
}
}
function restart() {
var video = document.getElementById("Video1");
video.currentTime = 0;
}
function skip(value) {
var video = document.getElementById("Video1");
video.currentTime += value;
}
</script>
</head>
<body>
<video id="Video1" >
// Replace these with your own video files.
<source src="demo.mp4" type="video/mp4" />
<source src="demo.ogv" type="video/ogg" />
HTML5 Video is required for this example.
<a href="demo.mp4">Download the video</a> file.
</video>
<div id="buttonbar">
<button id="restart" onclick="restart();">[]</button>
<button id="rew" onclick="skip(-10)"><<</button>
<button id="play" onclick="vidplay()">></button>
<button id="fastFwd" onclick="skip(10)">>></button>
</div>
But I've tried accessing the currentTime and other function on the videoTextures and I get a console response that in the case of:
video.currentTime
I receive a console error of : Uncaught ReferenceError: video is not defined
I would like to have all HTML5 video function available, and also be able to identify operations on multiple or individual video textures. If anyone knows the proper usage that I must be overlooking, please let me know.
Thanks,
DB