Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

隐藏助教的toolbar #128

Open
wants to merge 8 commits into
base: release/2.9.40
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/infra/capabilities/containers/screen-share/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
}

.local-screen-share-container {
display: flex;
justify-content: center;
position: absolute;
width: 100%;
top: 5px;
height: 100%;
z-index: 2;
pointer-events: none;
}

.local-screen-share-container .stop-button_wrap {
width: 108px;
height: 30;
position: absolute;
top: 5px;
left: 50%;
transform: translateX(-50%);
z-index: 999;
}
.local-screen-share-container .stop-button {
font-size: 12px;
width: 100%;
Expand Down
51 changes: 36 additions & 15 deletions src/infra/capabilities/containers/screen-share/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useStore } from '@classroom/infra/hooks/ui-store';
import { EduStream } from 'agora-edu-core';
import { EduClassroomConfig, EduRoomTypeEnum, EduStream } from 'agora-edu-core';
import { AGRenderMode } from 'agora-rte-sdk';
import classnames from 'classnames';
import { observer } from 'mobx-react';
Expand All @@ -9,25 +9,47 @@ import { useI18n } from 'agora-common-libs';
import './index.css';
import { ComponentLevelRules } from '../../config';

const ScreenShareLocalTrackPlayer = observer(() => {
const LocalScreenShare = observer(() => {
const ref = useRef<HTMLDivElement | null>(null);
const {
streamUIStore: {setupLocalScreenShare },
} = useStore();
useEffect(() => {
if (ref.current) {
setupLocalScreenShare(ref.current)
}
}, [ref.current]);
return (
<div style={{ width: '100%', height: '100%'}}
ref={ref}>
</div>
)
})

const ScreenShareLocalTrackPlayer = observer(({stream}:{stream:EduStream}) => {
const transI18n = useI18n();
const {
streamUIStore: { stopScreenShareCapture, localScreenShareOff },

streamUIStore: { stopScreenShareCapture, localScreenShareOff, setupLocalScreenShare },
} = useStore();

const [icon, setIcon] = useState(SvgIconEnum.SHARE_DEFAULT);
const isBigClass = EduClassroomConfig.shared.sessionInfo.roomType === EduRoomTypeEnum.RoomBigClass

return localScreenShareOff ? null : (
<div style={{ width: 108, height: 30 }}>
<button
className="stop-button"
onClick={stopScreenShareCapture}
onMouseEnter={() => setIcon(SvgIconEnum.SHARE_HOVER)}
onMouseLeave={() => setIcon(SvgIconEnum.SHARE_DEFAULT)}>
<SvgImg type={icon} style={{ display: 'flex', marginRight: 2 }} />
<span>{transI18n('scaffold.stop_screen_share')}</span>
</button>
</div>
<>
<div className='stop-button_wrap'>
<button
className="stop-button"
onClick={stopScreenShareCapture}
onMouseEnter={() => setIcon(SvgIconEnum.SHARE_HOVER)}
onMouseLeave={() => setIcon(SvgIconEnum.SHARE_DEFAULT)}>
<SvgImg type={icon} style={{ display: 'flex', marginRight: 2 }} />
<span>{transI18n('scaffold.stop_screen_share')}</span>
</button>
</div>
{isBigClass && stream && stream.isLocal ? <LocalScreenShare/>: null}
</>
);
});

Expand Down Expand Up @@ -72,7 +94,6 @@ export const ScreenShareContainer = observer<FC<ScreenShareContainerProps>>(
);

const localcls = classnames('local-screen-share-container', className);

return screenShareStream ? (
<React.Fragment>
{screenShareStream?.isLocal ? (
Expand All @@ -82,7 +103,7 @@ export const ScreenShareContainer = observer<FC<ScreenShareContainerProps>>(
top: `calc(100% - ${boardAreaHeight}px)`,
zIndex: ComponentLevelRules.ScreenShare,
}}>
<ScreenShareLocalTrackPlayer />
<ScreenShareLocalTrackPlayer stream={screenShareStream}/>
</div>
) : screenShareStream && !screenShareStream.isLocal ? (
<div className={remotecls} style={{ height: boardAreaHeight }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ export const ToolCabinetContainer = visibilityControl(
name,
};
});

const handleClick = useCallback((cabinetId: string) => {
setVisible(false);
isInstalled(cabinetId)
? openExtensionCabinet(cabinetId, false)
: openBuiltinCabinet(cabinetId);
if(isInstalled(cabinetId)){
openExtensionCabinet(cabinetId, false)
}else{
openBuiltinCabinet(cabinetId);
}
}, []);

return (
Expand Down
10 changes: 5 additions & 5 deletions src/infra/stores/common/group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,11 +700,11 @@ export class GroupUIStore extends EduUIStoreBase {

await this.classroomStore.connectionStore.joinRTC();

await this.classroomStore.connectionStore.checkIn(
EduClassroomConfig.shared.sessionInfo,
SceneType.Main,
'check-in'
);
// await this.classroomStore.connectionStore.checkIn(
// EduClassroomConfig.shared.sessionInfo,
// SceneType.Main,
// 'check-in'
// );
} catch (e) {
this.shareUIStore.addGenericErrorDialog(e as AGError);
} finally {
Expand Down
5 changes: 4 additions & 1 deletion src/infra/stores/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { VideoGalleryUIStore } from './video-gallery';
import { transI18n } from 'agora-common-libs';
import { Getters } from './getters';


export class EduClassroomUIStore {
protected _classroomStore: EduClassroomStore;
protected _boardUIStore: BoardUIStore;
Expand Down Expand Up @@ -192,7 +193,9 @@ export class EduClassroomUIStore {
async join() {
const { joinClassroom, joinRTC } = this.classroomStore.connectionStore;
try {
await joinClassroom();
await joinClassroom({
mode: "entry"
});
} catch (e) {
if (AGError.isOf(e as AGError, AGServiceErrorCode.SERV_CANNOT_JOIN_ROOM)) {
return this.classroomStore.connectionStore.leaveClassroom(LeaveReason.kickOut);
Expand Down
1 change: 1 addition & 0 deletions src/infra/stores/common/stream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export class StreamUIStore extends EduUIStoreBase {
@computed get screenShareStream(): EduStream | undefined {
const streamUuid = this.classroomStore.roomStore.screenShareStreamUuid as string;
const stream = this.classroomStore.streamStore.streamByStreamUuid.get(streamUuid);

return stream;
}

Expand Down
Loading