LiveDetailChatRoomController.ets
937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { ContentDetailDTO } from 'wdBean/Index'
import { LiveRoom } from './LiveRoom'
import { LiveRoomBaseInfo } from './LiveRoomBaseInfo'
import { LiveRoomManager } from './LiveRoomManager'
export class LiveDetailChatRoomController {
detail?: ContentDetailDTO
public configDetail(detail: ContentDetailDTO) {
this.detail = detail
let roomInfo = new LiveRoomBaseInfo()
roomInfo.roomID = detail.liveInfo.mlive.roomId
roomInfo.mliveID = detail.liveInfo.mlive.mliveId
roomInfo.liveID = detail.newsId + ""
this.listenConnect()
LiveRoomManager.sharedManager().connectLiveRoomWith(roomInfo)
}
listenConnect() {
LiveRoomManager.sharedManager().onConnectedRoom = (room: LiveRoom) => {
room.onJoined = (room: LiveRoom) => {
}
room.onJoinFailed = (room: LiveRoom, code: number) => {
}
room.onExited = (room: LiveRoom) => {
}
room.enterRoom()
}
}
}