|
|
|
@ -14,11 +14,11 @@ import Peers from './Peers';
|
|
|
|
|
import Stats from './Stats';
|
|
|
|
|
import Notifications from './Notifications';
|
|
|
|
|
import NetworkThrottle from './NetworkThrottle';
|
|
|
|
|
import { log } from 'gulp-util';
|
|
|
|
|
import UrlParse from 'url-parse';
|
|
|
|
|
|
|
|
|
|
class Room extends React.Component
|
|
|
|
|
{
|
|
|
|
|
render()
|
|
|
|
|
{
|
|
|
|
|
class Room extends React.Component {
|
|
|
|
|
render() {
|
|
|
|
|
const {
|
|
|
|
|
roomClient,
|
|
|
|
|
room,
|
|
|
|
@ -31,12 +31,26 @@ class Room extends React.Component
|
|
|
|
|
? 'dev'
|
|
|
|
|
: room.mediasoupClientVersion;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const urlParser = new UrlParse(window.location.href, true);
|
|
|
|
|
// 将字符串按 & 分隔
|
|
|
|
|
const parts = urlParser.href.split('&');
|
|
|
|
|
// 提取并解析每个部分
|
|
|
|
|
const params = parts.slice(1).reduce((acc, part) => {
|
|
|
|
|
const [key, value] = part.split('=');
|
|
|
|
|
if (key && value) acc[key] = value;
|
|
|
|
|
return acc;
|
|
|
|
|
}, {});
|
|
|
|
|
|
|
|
|
|
let roomId = params['roomId'];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Appear duration={300}>
|
|
|
|
|
<div data-component='Room'>
|
|
|
|
|
<div className='crumbs'>
|
|
|
|
|
<span className='goback' onClick={() => {
|
|
|
|
|
|
|
|
|
|
// 向主页面发送消息请求返回主页面
|
|
|
|
|
window.parent.postMessage('goBack', '*');
|
|
|
|
|
}}>
|
|
|
|
|
值班专家<span style={{ margin: '0 4px' }}>{`>`}</span>
|
|
|
|
|
</span>
|
|
|
|
@ -110,8 +124,7 @@ class Room extends React.Component
|
|
|
|
|
disabled: me.audioOnlyInProgress
|
|
|
|
|
})}
|
|
|
|
|
data-tip={'将参与者的视频 显示/隐藏'}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
onClick={() => {
|
|
|
|
|
me.audioOnly
|
|
|
|
|
? roomClient.disableAudioOnly()
|
|
|
|
|
: roomClient.enableAudioOnly();
|
|
|
|
@ -123,8 +136,7 @@ class Room extends React.Component
|
|
|
|
|
on: me.audioMuted
|
|
|
|
|
})}
|
|
|
|
|
data-tip={'将参与者的音频 静音/取消静音'}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
onClick={() => {
|
|
|
|
|
me.audioMuted
|
|
|
|
|
? roomClient.unmuteAudio()
|
|
|
|
|
: roomClient.muteAudio();
|
|
|
|
@ -161,8 +173,7 @@ class Room extends React.Component
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount()
|
|
|
|
|
{
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
const { roomClient } = this.props;
|
|
|
|
|
|
|
|
|
|
roomClient.join();
|
|
|
|
@ -178,8 +189,7 @@ Room.propTypes =
|
|
|
|
|
onRoomLinkCopy: PropTypes.func.isRequired
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) =>
|
|
|
|
|
{
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
|
|
return {
|
|
|
|
|
room: state.room,
|
|
|
|
|
me: state.me,
|
|
|
|
@ -187,11 +197,9 @@ const mapStateToProps = (state) =>
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) =>
|
|
|
|
|
{
|
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
|
|
|
return {
|
|
|
|
|
onRoomLinkCopy : () =>
|
|
|
|
|
{
|
|
|
|
|
onRoomLinkCopy: () => {
|
|
|
|
|
dispatch(requestActions.notify(
|
|
|
|
|
{
|
|
|
|
|
text: '房间链接已复制到剪贴板'
|
|
|
|
|