ssfg 5 年之前
父节点
当前提交
588d379529
共有 5 个文件被更改,包括 30 次插入27 次删除
  1. 0 3
      pages/index/index.wxml
  2. 4 1
      pages/zbDetails/zbDetails.js
  3. 8 12
      pages/zbDetails/zbDetails.wxml
  4. 10 3
      pages/zbDetails/zbDetails.wxss
  5. 8 8
      utils/util.js

+ 0 - 3
pages/index/index.wxml

@@ -1,7 +1,4 @@
 <view class="container">
-	<!-- <web-view src="https://www.baidu.com/"></web-view> -->
-	<!-- <image src='https://bkthnsz2.oss-cn-shenzhen.aliyuncs.com/20200629134722.gif' mode='aspectFill' style="width:750rpx;height:1334rpx" wx:if="{{kjShow}}"></image> -->
-	<!-- <live-pusher id="myLive" url="rtmp://live.spaceships.cn/wxedu/sntalk1?auth_key=1593483956-0-0-927e57bc397d22b01300f1b212e04da3" mode="RTC" autopush="true" enable-camera="true" style="width: 300px; height: 225px;border:1px solid red" /> -->
 	<view class="banner">
 		<swiper class='u-wrp-bnr' indicator-dots="true" interval='5000' duration='1000'>
 			<block wx:for="{{bnrUrl}}" wx:for-index="index" wx:key="idx">

+ 4 - 1
pages/zbDetails/zbDetails.js

@@ -190,7 +190,7 @@ Page({
         })
       }
       if (res.messageType == "studentPushStream") {
-        console.log(res.pushUrl, "我收到了举手的推流")
+        console.log(res, "我收到了举手的推流")
         _this.setData({
           isHands: true,
           pushUrl: res.pushUrl
@@ -202,6 +202,7 @@ Page({
           isHands: false,
           pushUrl: ""
         })
+        _this.data.videoContext.stop()
       }
     })
   },
@@ -297,6 +298,7 @@ Page({
       wx.closeSocket()
     }
     clearInterval(this.data.timeoutObj);
+    _this.data.videoContext.stop()
   },
   onUnload() {
     this.setData({
@@ -306,6 +308,7 @@ Page({
       wx.closeSocket()
     }
     clearInterval(this.data.timeoutObj);
+    _this.data.videoContext.stop()
   },
   onLoad: function (options) {
     var _this = this;

+ 8 - 12
pages/zbDetails/zbDetails.wxml

@@ -1,20 +1,16 @@
 <view class="home">
 	<view class="big_box">
 		<live-player src="{{url}}" id="livectx" orientation="{{spfx}}" mode="live" autoplay bindstatechange="statechange" binderror="error" controls style="width:100%;height:100%">
-			<cover-view class="exit-full-img">
-				<cover-view wx:if="{{fullScreenFlag}}" bindtap="fullScreen">
-					<button plain="false" style="color:#fff">退出全屏</button>
-				</cover-view>
-				<cover-view wx:else bindtap="fullScreen">
-					<button plain="false" style="color:#fff">全屏</button>
-				</cover-view>
+			<cover-view wx:if="{{fullScreenFlag}}" bindtap="fullScreen" class="full_btn">
+				<button plain="false" style="color:#fff">退出全屏</button>
+			</cover-view>
+			<cover-view wx:else bindtap="fullScreen">
+				<button plain="false" style="color:#fff">全屏</button>
 			</cover-view>
 		</live-player>
-		<cover-view>
-			<view class="{{fullScreenFlag==false?'push_box':'allpush_box'}}" wx:if="{{isHands}}">
-				<live-pusher orientation="{{spfx1}}" id="video-livePusher" mirror="false" mode="RTC" autopush url="{{pushUrl}}" bindstatechange="statechange" style="width:100%;height:100%"></live-pusher>
-			</view>
-		</cover-view>
+		<view class="push_box" wx:if="{{isHands}}">
+			<live-pusher orientation="{{spfx1}}" id="video-livePusher" mirror="false" mode="RTC" autopush url="{{pushUrl}}" bindstatechange="statechange" style="width:100%;height:100%"></live-pusher>
+		</view>
 	</view>
 	<view class="text_box">
 		<view class="title">{{title}}</view>

+ 10 - 3
pages/zbDetails/zbDetails.wxss

@@ -4,17 +4,25 @@
 page {
   background-color: #f2f2f2;
 }
+
 .big_box {
   width: 750rpx;
   height: 500rpx;
   /* border: 1px solid red; */
 }
+
 /* 
 .allbig_box {
   width: 100%;
   height: 100vh;
   border: 1px solid yellow;
 } */
+.full_btn {
+  position: absolute;
+  right: -100rpx;
+  top: 50%;
+  transform:rotate(90deg);
+}
 
 .text_box {
   width: 90%;
@@ -118,12 +126,11 @@ page {
   z-index: 99999;
 }
 
-.allpush_box {
+/* .allpush_box {
   width: 200rpx;
   height: 200rpx;
   position: absolute;
   left: 0;
   bottom: -300rpx;
-  /* border: 1px solid red; */
   z-index: 99999;
-}
+} */

+ 8 - 8
utils/util.js

@@ -1,12 +1,12 @@
 const globalData = {
-  publicUrl: 'https://sqdx.windd.cn',
-  publicUrl2: 'https://sqdx.windd.cn',
-  publicUrl3: 'https://sqdx.windd.cn',
-  publicSocketUrl: 'wss://sqdx.windd.cn'
-  // publicUrl: 'http://10.16.10.139:8090', //luyu
-  // publicUrl2: 'http://10.16.10.139:8090', //huyubo
-  // publicUrl3: 'http://10.16.10.139:8090', //zxq
-  // publicSocketUrl: 'ws://10.16.10.139:8090'
+  // publicUrl: 'https://sqdx.windd.cn',
+  // publicUrl2: 'https://sqdx.windd.cn',
+  // publicUrl3: 'https://sqdx.windd.cn',
+  // publicSocketUrl: 'wss://sqdx.windd.cn'
+  publicUrl: 'http://10.16.10.139:8090', //luyu
+  publicUrl2: 'http://10.16.10.139:8090', //huyubo
+  publicUrl3: 'http://10.16.10.139:8090', //zxq
+  publicSocketUrl: 'ws://10.16.10.139:8090'
 };
 module.exports = {
   globalData: globalData,