2022-04-20, 09:50:40
Hi, I am facing an issue fetching the value of the pages Java variables.
I am able to send commands to start, stop, change volume and seek just fine. The below is an example on how I am changing the play position:
EdgeWebBrowser.ExecuteScript “player.currentTime(" & mySlider.Value & ")"
I can’t however read the current values of whereyouat or lengthOfVideo. It keeps returning an empty string when using document.OnRequestElementValueById or document.OnRequestElementValueByName
I don’t think the getcurrenthtml is an option, as I don’t see it pulling any of the video player variables.
The HTML that I am using is below.
If you can point me in the right direction, that would be great.
I am able to send commands to start, stop, change volume and seek just fine. The below is an example on how I am changing the play position:
EdgeWebBrowser.ExecuteScript “player.currentTime(" & mySlider.Value & ")"
I can’t however read the current values of whereyouat or lengthOfVideo. It keeps returning an empty string when using document.OnRequestElementValueById or document.OnRequestElementValueByName
I don’t think the getcurrenthtml is an option, as I don’t see it pulling any of the video player variables.
The HTML that I am using is below.
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="container">
<link href="../videojs/skins/nuevo/videojs.min.css" rel="stylesheet"
type="text/css" />
<script src="../videojs/video.min.js"></script>
<script src="../videojs/nuevo.min.js"></script>
<div class="media-parent">
<div class="media-child">
<video id="player" class="video-js vjs-fluid" controls preload="auto" playsinline
poster="{THUMB}" type="video/mp4" >
</video>
</div>
</div>
<script>
var player = videojs('player');
player.src({ type: 'video/mp4', src:'{URL}'})
player.nuevo({
contextMenu: false,
controlbar: false,
});
</script>
<script>
// Variables
var elem = document.getElementById("player");
var whereYouAt = player.currentTime();
var lengthOfVideo = player.duration();
function openFullscreen() {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.webkitRequestFullscreen) { /* Safari */
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { /* IE11 */
elem.msRequestFullscreen();
}
}
</script>
</div>
</body>
</html>
If you can point me in the right direction, that would be great.