Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting Javascript Vars
#1
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.

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.
Reply


Messages In This Thread
Getting Javascript Vars - by maddire - 2022-04-20, 09:50:40
RE: Getting Javascript Vars - by wila - 2022-04-20, 10:37:47
RE: Getting Javascript Vars - by maddire - 2022-04-20, 10:59:58
RE: Getting Javascript Vars - by wila - 2022-04-20, 11:33:07
RE: Getting Javascript Vars - by maddire - 2022-04-20, 13:43:25
RE: Getting Javascript Vars - by wila - 2022-04-20, 17:12:35
RE: Getting Javascript Vars - by maddire - 2022-04-20, 18:30:49
RE: Getting Javascript Vars - by maddire - 2022-04-22, 18:20:58
RE: Getting Javascript Vars - by wila - 2022-04-25, 08:40:43

Forum Jump:


Users browsing this thread: 1 Guest(s)