Browse Source

新增删除用户不能观看

Limengbo 4 years ago
parent
commit
30594a2271
4 changed files with 28 additions and 43 deletions
  1. 1 1
      build/webpack.dev.conf.js
  2. 1 0
      src/index.html
  3. 18 42
      src/js/main.js
  4. 8 0
      src/style/index.less

+ 1 - 1
build/webpack.dev.conf.js

@@ -8,7 +8,7 @@ module.exports = merge(baseConfig, {
     contentBase: path.join(__dirname, 'dist'),
     open: true,
     compress: true,
-    port: 8888
+    port: 8889
   },
   module:{
     rules: [

+ 1 - 0
src/index.html

@@ -33,6 +33,7 @@
       <div class="small-video" id="smallVideo">
       </div>
     </div>
+    <div class="err" style="display: none">暂无观看权限,请联系管理员</div>
     <div class="footer">COPYRIGHT (©) 2018 智能共享白板. 京ICP备12019481号-5</div>
   </div>
 </body>

+ 18 - 42
src/js/main.js

@@ -15,37 +15,6 @@ $(document).ready(function() {
   $('.title p').html(title)
   console.log(boardUrl)
   console.log(desktopUrl)
-  // 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,
-	// 	"volume": 1,
-  //   "autoplay": true,
-  //   "width": "100%",
-  //   "height": "714",
-  //   "ignores": ['definition', 'i18n', 'play', 'replay', 'progress', 'start', 'time'],
-  //   "closeVideoClick": true,
-  //   "closeVideoTouch": true,
-  //   "keyShortcut": "off",
-  //   "cssFullscreen": true
-  // })
-  // let smallVideo = new Player({
-	// 	"id": "smallVideo",
-	// 	"url": "//chimee.org/vod/1.mp4",
-	// 	"playsinline": false,
-	// 	"volume": 0,
-  //   "autoplay": true,
-  //   "width": "100%",
-  //   "height": "714",
-  //   "ignores": ['definition', 'i18n', 'play', 'replay', 'progress', 'start', 'time'],
-  //   "closeVideoClick": true,
-  //   "closeVideoTouch": true,
-  //   "keyShortcut": "off",
-  //   "cssFullscreen": true
-  // })
-  // smallVideo.on('exitFullscreen',function(){
-  //   console.log('2退出全屏')
-  // })
   let bigVideo = new FlvJsPlayer({
 		"id": "bigVideo",
 		"url": boardUrl,
@@ -86,17 +55,24 @@ $(document).ready(function() {
     smallVideo.volume = 1;
     console.log(smallVideo.volume);
   })
+  let time = null;
   // 判断用户是否存在回调
-  function shareJoin () {
-    setTimeout(function () {
-      $.get(`${process.env.BASE_API}sharedWhiteBoard/shareJoin/update`, {
-        shareJoinUserId
-      }, function (res) {
-        if(res.code == 200) {
-          shareJoin();
+  time = setInterval(function () {
+    $.get(`${process.env.BASE_API}sharedWhiteBoard/shareJoin/update`, {
+      shareJoinUserId
+    }, function (res) {
+      if(res.code == 200) {
+        if(res.data.status == 'DEL') {
+          // alert('暂无观看权限');
+          bigVideo.destroy();
+          smallVideo.destroy();
+          $('.title p').hide();
+          $('.video').css('background', '#ccc');
+          $('.err').show();
+          clearTimeout(time);
+          // window.location.href="./login.html";            
         }
-      });
-    },5000)
-  }
-  shareJoin();
+      }
+    });
+  },5000)
 })

+ 8 - 0
src/style/index.less

@@ -64,6 +64,14 @@
     //   z-index: 2;
     // }
   }
+  .err {
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    transform: translate(-50%, -50%);
+    font-size: 36px;
+    color: red;
+  }
   .footer {
     width: 100%;
     height: 73px;