视频监控
This commit is contained in:
parent
300194a8e4
commit
51780c02ac
|
|
@ -113,7 +113,9 @@ Page({
|
|||
setting: {
|
||||
voiceStimulation: true, //语音激励
|
||||
},
|
||||
network: 0
|
||||
network: 0,
|
||||
meSrc: '',
|
||||
watchUids: []
|
||||
},
|
||||
watch: {
|
||||
'roomUserList.**': function (roomUserList) {
|
||||
|
|
@ -665,13 +667,22 @@ Page({
|
|||
this.setAllUserListData('ManagerRefresh', item, async () => {
|
||||
if (item.user.uid === item.uid) {
|
||||
if (item.user.uid === userInfo.uid) {
|
||||
// await agora.allLeaveChannelEx()
|
||||
await agora.allJoinChannelEx(item.user, false, (url: string) => {
|
||||
const roomUserListTemp = [...this.data.roomUserList]
|
||||
const itemUser = roomUserListTemp.find(row => row.uid == userInfo.uid)
|
||||
itemUser.src = url
|
||||
this.setData({
|
||||
meSrc: url,
|
||||
roomUserList: roomUserListTemp,
|
||||
})
|
||||
})
|
||||
this.message(`操作成功`).success()
|
||||
await agora.setRole(item.user.isRoomManager, (url: string) => {
|
||||
const roomUserListTemp = [...this.data.roomUserList]
|
||||
const itemUser = roomUserListTemp.find(row => row.uid == userInfo.uid)
|
||||
itemUser.src = url
|
||||
this.setData({
|
||||
meSrc: url,
|
||||
roomUserList: roomUserListTemp,
|
||||
})
|
||||
})
|
||||
|
|
@ -682,15 +693,22 @@ Page({
|
|||
}
|
||||
} else {
|
||||
if (item.user.uid === userInfo.uid) {
|
||||
if (item.user.isRoomManager) {
|
||||
// await agora.allLeaveChannelEx()
|
||||
}
|
||||
await agora.allJoinChannelEx(item.user, false, (url: string) => {
|
||||
const roomUserListTemp = [...this.data.roomUserList]
|
||||
const itemUser = roomUserListTemp.find(row => row.uid == userInfo.uid)
|
||||
itemUser.src = url
|
||||
this.setData({
|
||||
meSrc: url,
|
||||
roomUserList: roomUserListTemp,
|
||||
})
|
||||
})
|
||||
this.message(`管理员${item.user.isRoomManager ? '设置' : '取消'}您为发言人`).success()
|
||||
await agora.setRole(item.user.isRoomManager, (url: string) => {
|
||||
const roomUserListTemp = [...this.data.roomUserList]
|
||||
const itemUser = roomUserListTemp.find(row => row.uid == userInfo.uid)
|
||||
itemUser.src = url
|
||||
this.setData({
|
||||
meSrc: url,
|
||||
roomUserList: roomUserListTemp,
|
||||
})
|
||||
})
|
||||
|
|
@ -719,10 +737,30 @@ Page({
|
|||
case 'Watch':
|
||||
if (!role.ID.includes(userInfo.roleId)) {
|
||||
let userId = item.watchUids.find((uid: any) => uid === userInfo.uid)
|
||||
this.setData({
|
||||
watchUids: item.watchUids
|
||||
})
|
||||
let userRow = this.data.roomUserList.find((row: any) => row.uid === userId)
|
||||
if (userId) {
|
||||
// await agora.allJoinChannelEx()
|
||||
await agora.allJoinChannelEx(userRow, true, (url: string) => {
|
||||
const roomUserListTemp = [...this.data.roomUserList]
|
||||
const itemUser = roomUserListTemp.find(row => row.uid == userInfo.uid)
|
||||
itemUser.src = url
|
||||
this.setData({
|
||||
roomUserList: roomUserListTemp,
|
||||
meSrc: url,
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// await agora.allLeaveChannelEx()
|
||||
await agora.allJoinChannelEx(userRow, false, (url: string) => {
|
||||
const roomUserListTemp = [...this.data.roomUserList]
|
||||
const itemUser = roomUserListTemp.find(row => row.uid == userInfo.uid)
|
||||
itemUser.src = url
|
||||
this.setData({
|
||||
roomUserList: roomUserListTemp,
|
||||
meSrc: url,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -1246,7 +1284,10 @@ Page({
|
|||
footerListTemplate[1].active = item.enableMicr
|
||||
footerListTemplate[2].active = item.enableCamera
|
||||
item.enableMicr ? await agora.unmuteLocal('audio') : await agora.muteLocal('audio')
|
||||
item.enableCamera ? await agora.unmuteLocal('video') : await agora.muteLocal('video')
|
||||
let userId = this.data.watchUids.find((uid: any) => uid === userInfo.uid)
|
||||
if (!userId) {
|
||||
item.enableCamera ? await agora.unmuteLocal('video') : await agora.muteLocal('video')
|
||||
}
|
||||
if (!role.ID.includes(userInfo.roleId)) {
|
||||
footerListTemplate[6].active = !item.isRoomManager;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="meeting-content-smallvideo-box-view-canvas" wx:if="{{item.src}}">
|
||||
<live-pusher wx:if="{{user.uid === item.uid}}" url="{{item.src}}" mode="RTC" object-fit="contain" background-mute enable-mic="{{footerList[1].active}}" enable-camera max-bitrate="500" min-bitrate="200" autopush enable-agc enable-ans device-position="front" class="meeting-content-smallvideo-box-view-canvas-play" data-uid="{{item.uid}}" bindaudiovolumenotify="playerAudioVolumenotify" beauty='{{9}}' whiteness='{{9}}' />
|
||||
<live-player src="{{item.src}}" class="meeting-content-smallvideo-box-view-canvas-play" mode="RTC" autoplay="true" muted="{{item.uid === user.uid ? true : !item.enableMicr}}" object-fit="contain" data-uid="{{item.uid}}" bindaudiovolumenotify="playerAudioVolumenotify" wx:else />
|
||||
<live-player src="{{item.src}}" class="meeting-content-smallvideo-box-view-canvas-play" mode="RTC" autoplay="true" muted="{{item.uid === user.uid ? true : !item.enableMicr}}" object-fit="contain" data-uid="{{item.uid}}" bindaudiovolumenotify="playerAudioVolumenotify" />
|
||||
</view>
|
||||
<view class="meeting-content-smallvideo-box-view-user">
|
||||
<view class="meeting-content-smallvideo-box-view-user-view" wx:if="{{item.roleId === '1' || item.roleId === '3'}}" style=" background:#FDC229">
|
||||
|
|
@ -71,6 +70,9 @@
|
|||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view style="position: fixed;left: -99999;z-index: -100;">
|
||||
<live-pusher url="{{meSrc}}" mode="RTC" object-fit="contain" background-mute enable-mic="{{footerList[1].active}}" enable-camera max-bitrate="500" min-bitrate="200" autopush enable-agc enable-ans device-position="front" data-uid="{{user.uid}}" bindaudiovolumenotify="playerAudioVolumenotify" beauty='{{9}}' whiteness='{{9}}' />
|
||||
</view>
|
||||
<view class="meeting-footer" wx:if="{{!isFullscreen}}">
|
||||
<view class="meeting-footer-left">`
|
||||
<view class="meeting-footer-left-view" wx:for="{{footerList}}" wx:for-index="index" wx:for-item="item" wx:key="index" bind:tap="changeFooterList" data-index='{{index}}' wx:if="{{item.show}}">
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { role } from "./utils";
|
||||
const AgoraMiniappSDK = require("../lib/agora-miniapp-sdk.js");
|
||||
const option = {
|
||||
appId: '',
|
||||
|
|
@ -58,6 +59,15 @@ export const agora = {
|
|||
})
|
||||
})
|
||||
},
|
||||
// 监控
|
||||
allJoinChannelEx: async (user: any, bool: boolean, callBack: Function) => {
|
||||
if (!role.ID.includes(user.roleId) || !user.isRoomManager) {
|
||||
await agora.setRole(bool, (url: string) => {
|
||||
callBack(url);
|
||||
})
|
||||
}
|
||||
bool ? await agora.unmuteLocal('video') : await agora.muteLocal('video')
|
||||
},
|
||||
// 刷新token
|
||||
renewToken: (token) => {
|
||||
client.renewToken(token)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// const apiBase = "http://192.168.2.9:5192"
|
||||
const apiBase = "https://meeting-api.23544.com/pc"
|
||||
// const apiBase = "https://meeting-api.23544.com/test29"
|
||||
// const apiBase = "https://meeting-api.23544.com/pc"
|
||||
const apiBase = "https://meeting-api.23544.com/test29"
|
||||
export const Request = (params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.getStorage({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
let connection = '' as any;
|
||||
// let url = 'http://192.168.2.9:5192'
|
||||
let url = 'https://meeting-api.23544.com/pc'
|
||||
// let url = 'https://meeting-api.23544.com/test29'
|
||||
// let url = 'https://meeting-api.23544.com/pc'
|
||||
let url = 'https://meeting-api.23544.com/test29'
|
||||
import * as signalR from "signalr-for-wx";
|
||||
import { agora } from "./agora";
|
||||
export const startSignalr = async (callBack: Function) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue