123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <!DOCTYPE html>
- <html>
- <head>
- <metacharset ="utf-8">
- <title>test</title>
- </head>
- <body>
- <div style="text-align:center">
- <button onclick="playPause()">>play</button>
- <button onclick="makeBig()">111</button>
- <button onclick="makeSmall()">1222</button>
- <button onclick="makeNormal()">333</button>
- <br>
- <video id="video1" width="420">
- <source src="http://yfklxt-video.ai160.com/vs2m/001/00103200/00103200020/00103200020.m3u8" type="video/mp4">
- </video>
- </div>
- <script>
- //需要用到就写这个,不需要就不写(用到哪个写哪个,对应winform的JavascriptObjectRepository.ResolveObject方法)
- let bindName = ["efunboxJS", "videoJS"];
- bindName.forEach(item => {
- CefSharp.BindObjectAsync(item);
- })
- var myVideo = document.getElementById("video1");
- function playPause() {
- efunboxJS.showMessage("test");
- if (myVideo.paused)
- myVideo.play();
- else
- myVideo.pause();
- }
- function makeBig() {
- myVideo.width = 560;
- }
- function makeSmall() {
- myVideo.width = 320;
- }
- function makeNormal() {
- myVideo.width = 420;
- }
- </script>
- </body>
- </html>
|