Home > @bilibili-live/web-player-biz > RoomPlayer
# RoomPlayer class
房间页播放器可调用的方法在IRoomPlayer上
Signature:
export declare class RoomPlayer
# Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(container, opts) | Constructs a new instance of the RoomPlayer class |
# Properties
Property | Modifiers | Type | Description |
---|---|---|---|
container | HTMLDivElement | ||
destroy | () => void | ||
emit | EventBus<ExternalEventType>['emit'] | 抛出一个事件给外部监听器 | |
getOperableElements | () => { mainElement: HTMLDivElement; } | 返回外部可操作播放器内部DIV层级元素 | |
injectInitAPIData | (data: IInjectParam) => void | 初始化时外部注入数据,仅用于弹幕屏蔽规则 | |
isSupported | static | typeof isSupported | |
notifyAnnouncement | (status: boolean, height: number) => void | 展示公告, 弹幕避让 | |
on | EventBus<ExternalEventType>['on'] | ||
once | EventBus<ExternalEventType>['once'] | ||
reload | () => Promise<void> | ||
updateRoomStatus | (s: number) => void | 更新房间状态 房间正常状态只有RoomStatus,但 Socket 可能下发消息紧急关闭房间(异常状态) 异常状态暂不污染 RoomPlayer, 避免增加复杂性 |