Limengbo 4 лет назад
Родитель
Сommit
52779cf38f
2 измененных файлов с 19 добавлено и 31 удалено
  1. 1 1
      src/index.html
  2. 18 30
      src/js/main.js

+ 1 - 1
src/index.html

@@ -14,7 +14,7 @@
     <div class="header">智能共享白板</div>
     <div class="video">
       <div class="title">
-        <p>11111</p>
+        <p></p>
         <!-- <div id="btn">
             <label>
                 <input type="radio" name="type" id="adviceRadio2" value="desktopUrl" checked hidden/>

+ 18 - 30
src/js/main.js

@@ -15,7 +15,7 @@ $(document).ready(function() {
   $('.title p').html(title)
   console.log(boardUrl)
   console.log(desktopUrl)
-  // new Player({
+  // let bigVideo = new Player({
 	// 	"id": "bigVideo",
 	// 	"url": "//s1.pstatp.com/cdn/expire-1-M/byted-player-videos/1.0.0/xgplayer-demo.mp4",
 	// 	"playsinline": false,
@@ -29,9 +29,9 @@ $(document).ready(function() {
   //   "keyShortcut": "off",
   //   "cssFullscreen": true
   // })
-  // new Player({
+  // let smallVideo = new Player({
 	// 	"id": "smallVideo",
-	// 	"url": "//s1.pstatp.com/cdn/expire-1-M/byted-player-videos/1.0.0/xgplayer-demo.mp4",
+	// 	"url": "//chimee.org/vod/1.mp4",
 	// 	"playsinline": false,
 	// 	"volume": 0,
   //   "autoplay": true,
@@ -43,7 +43,9 @@ $(document).ready(function() {
   //   "keyShortcut": "off",
   //   "cssFullscreen": true
   // })
-
+  // smallVideo.on('exitFullscreen',function(){
+  //   console.log('2退出全屏')
+  // })
   let bigVideo = new FlvJsPlayer({
 		"id": "bigVideo",
 		"url": boardUrl,
@@ -72,32 +74,18 @@ $(document).ready(function() {
     "keyShortcut": "off",
     "cssFullscreen": true
   });
-  // $('#smallVideo').hide();
-  // $('#smallVideo').click(function () {
-  //   $('#bigVideo').removeClass('big-video').addClass('small-video');
-  //   $('#smallVideo').removeClass('small-video').addClass('big-video');
-  //   smallVideo.muted = false;
-  //   bigVideo.muted = true;
-  // })
-  // $('#bigVideo').click(function () {
-  //   $('#bigVideo').removeClass('small-video').addClass('big-video');
-  //   $('#smallVideo').removeClass('big-video').addClass('small-video');
-  //   smallVideo.muted = true;
-  //   bigVideo.muted = false;
-  // })
-  // $('input:radio').click(function () {
-  //   // console.log($(this).val())
-  //   const type = $(this).val();
-  //   if (type == 'desktopUrl') {
-  //     $('#bigVideo').show();
-  //     $('#smallVideo').hide();
-  //   } else {
-  //     $('#bigVideo').hide();
-  //     $('#smallVideo').show();
-  //   }
-  //   // player.flvOpts.url = 'http://aldirect.flv.huya.com/huyalive/94525224-2460686034-10568566041753944064-2789274542-10057-A-0-1.flv?wsSecret=a90ccc2ccf9420344d388def9c190893&wsTime=5ced08e1&ratio=500'
-  //   // console.log(player.config.url)
-  // })
+  bigVideo.on('requestFullscreen',function(){
+    console.log('1全屏')
+    bigVideo.volume = 1;
+    smallVideo.volume = 0;
+    console.log(bigVideo.volume);
+  })
+  smallVideo.on('requestFullscreen',function(){
+    console.log('2全屏')
+    bigVideo.volume = 0;
+    smallVideo.volume = 1;
+    console.log(smallVideo.volume);
+  })
   // 判断用户是否存在回调
   function shareJoin () {
     setTimeout(function () {