//视频/全屏
import win.ui;
/*DSG{{*/
var winform = win.form(text="WebView2(web.view) 播放视频并支持全屏";right=1008;bottom=616)
winform.add()
/*}}*/

import web.form.ie11; 
var wb = web.form.ie11( winform );

//导出网页 JavaScript 可调用的 external 对象。
wb.external = {
	//浏览器仅仅是发出全屏指令,在这里用 aardio 控制全屏
	fullscreen = lambda(fs) winform.fullscreen(fs) 
}

wb.html = /**
<html>
<head>
    <style type="text/css">
        html,body { height: 100%; width: 100%; margin: 0;overflow: hidden; }
    </style>
    
    <!--第一步：引入下面2个文件加载播放器 -->
    <link href="https://cdn.jsdelivr.net/npm/video.js@7.15.4/dist/video-js.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/video.js@7.15.4/dist/video.min.js"></script>
</head>
<body>

	<!-- 第二步：插入视频文件 -->
    <video id="my-player" class="video-js" controls preload="auto" poster="https://vjs.zencdn.net/v/oceans.png"
        style="width:100%;height:100%" data-setup='{}'>
        <source src="http://download.aardio.com/demo/video.aardio" type=" video/mp4">
        </source>
    </video>

    <script>

		//第三步：修改播放器选项,这一步可以省略
        videojs("my-player", {
            controlBar: {
                fullscreenToggle: true
            }
        });

        //第四步：响应网页全屏请求注意 MSFullscreenChange 大小写不能错
		document.addEventListener("MSFullscreenChange", function () {
   			external.fullscreen(!!document.msFullscreenElement)
		}, false);  
    </script>
</body></html>
**/ 

winform.show(); 
win.loopMessage();