comein-player-web 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/index.css +98 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.esm.js +114948 -0
- package/dist/index.umd.js +79 -0
- package/package.json +29 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface WebSdkUserInfo {
|
|
2
|
+
uid: string;
|
|
3
|
+
token: string;
|
|
4
|
+
webtoken?: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type WebSdkLocale = 'zh-cn' | 'en' | 'zh-hant' | 'ja';
|
|
9
|
+
|
|
10
|
+
export interface WebSdkOptions {
|
|
11
|
+
roadshowId?: string;
|
|
12
|
+
userInfo?: WebSdkUserInfo | string | null;
|
|
13
|
+
page?: 'roadshow' | 'room' | 'record';
|
|
14
|
+
playerType?: 'roadshow' | 'room' | 'record' | 'player' | string;
|
|
15
|
+
data?: Record<string, unknown>;
|
|
16
|
+
loginUrl?: string;
|
|
17
|
+
auth?: boolean;
|
|
18
|
+
locale?: WebSdkLocale;
|
|
19
|
+
isBuild?: boolean;
|
|
20
|
+
axios?: {
|
|
21
|
+
get(url: string, body?: Record<string, unknown>, options?: Record<string, unknown>): unknown;
|
|
22
|
+
post(url: string, body?: Record<string, unknown>, options?: Record<string, unknown>): unknown;
|
|
23
|
+
request?(config: Record<string, unknown>): unknown;
|
|
24
|
+
};
|
|
25
|
+
logstore?: string;
|
|
26
|
+
getUserInfo?: () => unknown;
|
|
27
|
+
bridge?: Record<string, unknown> & {
|
|
28
|
+
player?: Record<string, unknown>;
|
|
29
|
+
};
|
|
30
|
+
player?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface WebSdkPanel {
|
|
34
|
+
on(event: string, handler: (...args: any[]) => void): this;
|
|
35
|
+
off(event: string, handler?: (...args: any[]) => void): this;
|
|
36
|
+
destroy(): void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface WebPlayer {
|
|
40
|
+
on(event: string, handler: (...args: any[]) => void): this;
|
|
41
|
+
off(event: string, handler?: (...args: any[]) => void): this;
|
|
42
|
+
play(): unknown;
|
|
43
|
+
pause(): unknown;
|
|
44
|
+
seek(time: number): unknown;
|
|
45
|
+
setMode(mode: 'live' | 'rtc' | string): unknown;
|
|
46
|
+
setLocale(locale: WebSdkLocale): unknown;
|
|
47
|
+
changePage(page: number): unknown;
|
|
48
|
+
setVolume(volume: number): unknown;
|
|
49
|
+
resize(): unknown;
|
|
50
|
+
setDotList(list: Array<Record<string, unknown>>): unknown;
|
|
51
|
+
setOnlyPlayList(list: Array<{ startTime: number; endTime: number }>): unknown;
|
|
52
|
+
createChat(el: string | HTMLElement, options?: Record<string, unknown>): WebSdkPanel;
|
|
53
|
+
createQuestion(el: string | HTMLElement, options?: Record<string, unknown>): WebSdkPanel;
|
|
54
|
+
readonly socket: unknown;
|
|
55
|
+
readonly verify: string;
|
|
56
|
+
readonly isTrailer: boolean;
|
|
57
|
+
readonly isLive: boolean;
|
|
58
|
+
readonly liveStatus: boolean;
|
|
59
|
+
readonly isAccessWaitingRoom: boolean;
|
|
60
|
+
readonly status: number | undefined;
|
|
61
|
+
readonly isLiveRoadshow: boolean;
|
|
62
|
+
readonly liveMode: number | undefined;
|
|
63
|
+
readonly mode: 'live' | 'rtc' | string;
|
|
64
|
+
readonly locale: WebSdkLocale | string;
|
|
65
|
+
readonly volume: number;
|
|
66
|
+
readonly roadshowId: string;
|
|
67
|
+
readonly user: Record<string, unknown> | null;
|
|
68
|
+
readonly hasPlayback: boolean;
|
|
69
|
+
readonly pdfData: Record<string, unknown>;
|
|
70
|
+
readonly raiseStatus: 'none' | 'wait' | 'speak' | string;
|
|
71
|
+
destroy(): void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function createWebPlayer(
|
|
75
|
+
el: string | HTMLElement,
|
|
76
|
+
options: WebSdkOptions,
|
|
77
|
+
dependencies?: Record<string, unknown>
|
|
78
|
+
): Promise<WebPlayer>;
|