yangjie #47
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "WGShare.Metting",
|
||||
"private": true,
|
||||
"version": "0.6.3",
|
||||
"version": "0.6.5",
|
||||
"main": "main.js",
|
||||
"authors": "yj",
|
||||
"description": "智汇享",
|
||||
|
|
|
|||
|
|
@ -1182,6 +1182,7 @@ const Meeting: React.FC = () => {
|
|||
}
|
||||
},
|
||||
onTokenPrivilegeWillExpire: async (connection: RtcConnection, _token: string) => {
|
||||
console.log(connection);
|
||||
await GetRoomRtcToken(connection.channelId || '').then(res => {
|
||||
if (res.code === 200) {
|
||||
agora.refreshToken({
|
||||
|
|
@ -1766,31 +1767,35 @@ const Meeting: React.FC = () => {
|
|||
agora.setSubscribeVideoBlocklist([Number(user.screenShareId)], 1)
|
||||
}
|
||||
if (data) {
|
||||
const footerListTemplate = [...footerList]
|
||||
footerListTemplate[footerListIndex.itemIndex][footerListIndex.rowIndex].title = '停止共享'
|
||||
setIsSharedScreenModal(false)
|
||||
await agora.setDesktopCapturerVideo(sharedScreenItem, isComputerAudio, isFluencyPriority)
|
||||
await allUserLook(user.screenShareId, user.userName)
|
||||
const isOpen = await getKeyOpenChildWindow('shareScreenWindow')
|
||||
setIsScreenCapture(true)
|
||||
if (!isOpen) {
|
||||
window.electron.createChildWindow('show')
|
||||
setKeyOpenChildWindow('shareScreenWindow', true)
|
||||
window.electron.setMainWindowSize({
|
||||
width: 250,
|
||||
height: 160,
|
||||
})
|
||||
window.electron.setPosition('right')
|
||||
setTimeout(() => {
|
||||
agora.setupLocalVideo({
|
||||
uid: Number(user.uid),
|
||||
view: document.getElementById(`meetingAbsoluteVideo`) as HTMLElement,
|
||||
channelId: state.channelId,
|
||||
sourceType: VideoSourceType.VideoSourceCameraPrimary,
|
||||
type: true
|
||||
})
|
||||
}, 1500);
|
||||
}
|
||||
GetRoomRtcToken(state.channelId).then(async res => {
|
||||
if (res.code === 200) {
|
||||
const footerListTemplate = [...footerList]
|
||||
footerListTemplate[footerListIndex.itemIndex][footerListIndex.rowIndex].title = '停止共享'
|
||||
setIsSharedScreenModal(false)
|
||||
await agora.setDesktopCapturerVideo(sharedScreenItem, isComputerAudio, isFluencyPriority, res.data)
|
||||
await allUserLook(user.screenShareId, user.userName)
|
||||
const isOpen = await getKeyOpenChildWindow('shareScreenWindow')
|
||||
setIsScreenCapture(true)
|
||||
if (!isOpen) {
|
||||
window.electron.createChildWindow('show')
|
||||
setKeyOpenChildWindow('shareScreenWindow', true)
|
||||
window.electron.setMainWindowSize({
|
||||
width: 250,
|
||||
height: 160,
|
||||
})
|
||||
window.electron.setPosition('right')
|
||||
setTimeout(() => {
|
||||
agora.setupLocalVideo({
|
||||
uid: Number(user.uid),
|
||||
view: document.getElementById(`meetingAbsoluteVideo`) as HTMLElement,
|
||||
channelId: state.channelId,
|
||||
sourceType: VideoSourceType.VideoSourceCameraPrimary,
|
||||
type: true
|
||||
})
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
message.error('请选择应用!')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,10 +329,10 @@ export const agora = {
|
|||
)
|
||||
},
|
||||
// 共享屏幕单独用户
|
||||
joinChannelEx: async (uid: any) => {
|
||||
joinChannelEx: async (uid: any, token: string) => {
|
||||
await agora.leaveChannelEx(uid)
|
||||
await rtcEngine.joinChannelEx(
|
||||
option.token,
|
||||
token,
|
||||
{ channelId: option.channelId, localUid: Number(uid) },
|
||||
{
|
||||
autoSubscribeAudio: false,//设置是否自动订阅所有音频流
|
||||
|
|
@ -465,7 +465,7 @@ export const agora = {
|
|||
return await rtcEngine.getScreenCaptureSources(thumbSize, iconSize, includeScreen)
|
||||
},
|
||||
// 共享屏幕采集
|
||||
setDesktopCapturerVideo: async (targetSource: any, isComputerAudio: boolean, isFluencyPriority: boolean) => {
|
||||
setDesktopCapturerVideo: async (targetSource: any, isComputerAudio: boolean, isFluencyPriority: boolean, token:string) => {
|
||||
const user = JSON.parse(storage.getItem('user') as string)
|
||||
agora.stopScreenCapture();
|
||||
if (isComputerAudio) {
|
||||
|
|
@ -501,7 +501,7 @@ export const agora = {
|
|||
}
|
||||
);
|
||||
}
|
||||
await agora.joinChannelEx(user.screenShareId)
|
||||
await agora.joinChannelEx(user.screenShareId, token)
|
||||
},
|
||||
// 获取系统中所有的视频设备列表。
|
||||
getVideoDeviceManager: async (): Promise<any> => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue