larksr_websdk 3.2.339 → 3.2.341
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/dist/larksr-web-sdk.min.js +1 -1
- package/dist/types/lark/application.d.ts +5 -3
- package/dist/types/lark/canvas_render.d.ts +28 -0
- package/dist/types/lark/media_share_interface.d.ts +2 -2
- package/dist/types/lark/peer_connection.d.ts +5 -2
- package/dist/types/lark/peer_connection_media_share.d.ts +3 -2
- package/dist/types/larksr.d.ts +7 -2
- package/dist/types/protobuf/cloudlark.d.ts +127 -1
- package/dist/types/screen_state.d.ts +2 -0
- package/package.json +1 -1
- package/types/lark/application.d.ts +5 -3
- package/types/lark/canvas_render.d.ts +28 -0
- package/types/lark/media_share_interface.d.ts +2 -2
- package/types/lark/peer_connection.d.ts +5 -2
- package/types/lark/peer_connection_media_share.d.ts +3 -2
- package/types/larksr.d.ts +7 -2
- package/types/protobuf/cloudlark.d.ts +127 -1
- package/types/screen_state.d.ts +2 -0
|
@@ -44,7 +44,8 @@ export declare enum APP_EVENT_TYPE {
|
|
|
44
44
|
AI_VOICE_DM_RESULT = 20,
|
|
45
45
|
AI_VOICE_ERROR = 21,
|
|
46
46
|
RTMP_STREAM_STATE = 22,
|
|
47
|
-
RTMP_STREAM_ERROR = 23
|
|
47
|
+
RTMP_STREAM_ERROR = 23,
|
|
48
|
+
RTC_RETRY_SUCCESS = 24
|
|
48
49
|
}
|
|
49
50
|
export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
|
|
50
51
|
data?: any;
|
|
@@ -66,6 +67,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
66
67
|
get videoTrack(): MediaStreamTrack | null | undefined;
|
|
67
68
|
get audioPaused(): boolean | undefined;
|
|
68
69
|
get videoPaused(): boolean | undefined;
|
|
70
|
+
get serverFeatures(): Msg.CloudLark.INotifyFeatures | null | undefined;
|
|
69
71
|
private get sharePeerConnection();
|
|
70
72
|
private retryTime;
|
|
71
73
|
private larksr;
|
|
@@ -146,7 +148,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
146
148
|
closeVideo(): any;
|
|
147
149
|
closeShare(): any;
|
|
148
150
|
openAudio(deviceId?: string): Promise<any>;
|
|
149
|
-
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<any>;
|
|
151
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number, front?: boolean): Promise<any>;
|
|
150
152
|
openDefaultMedia(video?: boolean, audio?: boolean): Promise<any>;
|
|
151
153
|
openShareMediaDevice(): Promise<any>;
|
|
152
154
|
getConnectedAudioinputDevices(): Promise<any>;
|
|
@@ -154,7 +156,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
154
156
|
getConnectedVideoinputDevices(): Promise<any>;
|
|
155
157
|
getConnectedDevices(type: MediaDeviceKind): Promise<any>;
|
|
156
158
|
openAudioDevice(deviceId: string, kind?: "audioinput" | "audiooutput"): Promise<any>;
|
|
157
|
-
openCamera(cameraId: string, minWidth?: number, minHeight?: number): Promise<any>;
|
|
159
|
+
openCamera(cameraId: string, minWidth?: number, minHeight?: number, audio?: boolean, front?: boolean): Promise<any>;
|
|
158
160
|
openUserMeida(constraints?: MediaStreamConstraints, reset?: boolean): Promise<any>;
|
|
159
161
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean | undefined;
|
|
160
162
|
removeMediaTrack(track: RTCRtpSender): any;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import ScreenState from '@/screen_state';
|
|
2
|
+
export default class CanvasRender {
|
|
3
|
+
get canvas(): HTMLCanvasElement | null;
|
|
4
|
+
private set canvas(value);
|
|
5
|
+
private _canvas;
|
|
6
|
+
private context;
|
|
7
|
+
private width;
|
|
8
|
+
private height;
|
|
9
|
+
private video;
|
|
10
|
+
private drawFrames;
|
|
11
|
+
private stream;
|
|
12
|
+
private screenState;
|
|
13
|
+
private hasDeviceOrientationEvent;
|
|
14
|
+
private alpha;
|
|
15
|
+
private beta;
|
|
16
|
+
private gamma;
|
|
17
|
+
private isFront;
|
|
18
|
+
private currentRotateClock;
|
|
19
|
+
constructor(screenState: ScreenState);
|
|
20
|
+
init(stream: MediaStream): Promise<HTMLCanvasElement>;
|
|
21
|
+
draw(): void;
|
|
22
|
+
stopDrawing(): void;
|
|
23
|
+
clear(): void;
|
|
24
|
+
setRotate(clock: boolean): void;
|
|
25
|
+
clearRotate(): void;
|
|
26
|
+
setupRotateWithDeivce(): void;
|
|
27
|
+
private checkFront;
|
|
28
|
+
}
|
|
@@ -30,7 +30,7 @@ export interface MediaShareInterface {
|
|
|
30
30
|
closeVideo(): any;
|
|
31
31
|
closeShare(): any;
|
|
32
32
|
openAudio(deviceId: string): Promise<any>;
|
|
33
|
-
openVideo(audio: boolean, cameraId: string, width: number, height: number): Promise<any>;
|
|
33
|
+
openVideo(audio: boolean, cameraId: string, width: number, height: number, front?: boolean): Promise<any>;
|
|
34
34
|
openDefaultMedia(video: boolean, audio: boolean): Promise<any>;
|
|
35
35
|
openShareMediaDevice(): Promise<any>;
|
|
36
36
|
getConnectedAudioinputDevices(): Promise<any>;
|
|
@@ -38,7 +38,7 @@ export interface MediaShareInterface {
|
|
|
38
38
|
getConnectedVideoinputDevices(): Promise<any>;
|
|
39
39
|
getConnectedDevices(type: MediaDeviceKind): Promise<any>;
|
|
40
40
|
openAudioDevice(deviceId: string, kind: "audioinput" | "audiooutput"): Promise<any>;
|
|
41
|
-
openCamera(cameraId: string, minWidth: number, minHeight: number): Promise<any>;
|
|
41
|
+
openCamera(cameraId: string, minWidth: number, minHeight: number, audio: boolean, front?: boolean): Promise<any>;
|
|
42
42
|
openUserMeida(constraints?: MediaStreamConstraints, reset?: boolean): Promise<any>;
|
|
43
43
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean;
|
|
44
44
|
removeMediaTrack(track: RTCRtpSender): any;
|
|
@@ -106,6 +106,9 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
106
106
|
private videoBinding;
|
|
107
107
|
private readonly sendStream;
|
|
108
108
|
private sdpCreateSuccess;
|
|
109
|
+
private canvasRender;
|
|
110
|
+
get serverFeatures(): CloudLark.INotifyFeatures | null;
|
|
111
|
+
private _serverFeatures;
|
|
109
112
|
constructor(larksr: LarkSR, config: WebRTCConfig);
|
|
110
113
|
create(streams?: MediaStream | undefined | null, config?: CloudLark.IRTCConfiguration | null | undefined): Promise<void>;
|
|
111
114
|
createOffer(): void;
|
|
@@ -128,7 +131,7 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
128
131
|
streams: MediaStream;
|
|
129
132
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
130
133
|
}>;
|
|
131
|
-
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<{
|
|
134
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number, front?: boolean): Promise<{
|
|
132
135
|
streams: MediaStream;
|
|
133
136
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
134
137
|
}>;
|
|
@@ -145,7 +148,7 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
145
148
|
streams: MediaStream;
|
|
146
149
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
147
150
|
}>;
|
|
148
|
-
openCamera(cameraId: string, width?: number, height?: number, audio?: boolean): Promise<{
|
|
151
|
+
openCamera(cameraId: string, width?: number, height?: number, audio?: boolean, front?: boolean): Promise<{
|
|
149
152
|
streams: MediaStream;
|
|
150
153
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
151
154
|
}>;
|
|
@@ -33,6 +33,7 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
33
33
|
private videoBinding;
|
|
34
34
|
private sdpCreateSuccess;
|
|
35
35
|
private readonly sendStream;
|
|
36
|
+
private canvasRender;
|
|
36
37
|
constructor(larksr: LarkSR);
|
|
37
38
|
create(config?: CloudLark.IRTCConfiguration | null | undefined): Promise<void>;
|
|
38
39
|
createOffer(): void;
|
|
@@ -55,7 +56,7 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
55
56
|
streams: MediaStream;
|
|
56
57
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
57
58
|
}>;
|
|
58
|
-
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<{
|
|
59
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number, front?: boolean): Promise<{
|
|
59
60
|
streams: MediaStream;
|
|
60
61
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
61
62
|
}>;
|
|
@@ -72,7 +73,7 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
72
73
|
streams: MediaStream;
|
|
73
74
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
74
75
|
}>;
|
|
75
|
-
openCamera(cameraId: string, width?: number, height?: number, audio?: boolean): Promise<{
|
|
76
|
+
openCamera(cameraId: string, width?: number, height?: number, audio?: boolean, front?: boolean): Promise<{
|
|
76
77
|
streams: MediaStream;
|
|
77
78
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
78
79
|
}>;
|
package/dist/types/larksr.d.ts
CHANGED
|
@@ -647,6 +647,10 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
647
647
|
* 视频通道是否暂停
|
|
648
648
|
*/
|
|
649
649
|
get videoPaused(): boolean | undefined;
|
|
650
|
+
/**
|
|
651
|
+
* 服务器支持的功能列表
|
|
652
|
+
*/
|
|
653
|
+
get serverFeatures(): CloudLark.INotifyFeatures | null | undefined;
|
|
650
654
|
/**
|
|
651
655
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
652
656
|
* @param config 本地配置,优先级最高
|
|
@@ -1090,7 +1094,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
1090
1094
|
* @param cameraId 视频设备id,如果不传将打开默认设备。@see getConnectedVideoinputDevices
|
|
1091
1095
|
* @returns Promise
|
|
1092
1096
|
*/
|
|
1093
|
-
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<any>;
|
|
1097
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number, front?: boolean): Promise<any>;
|
|
1094
1098
|
/**
|
|
1095
1099
|
* 打开默认媒体设备,要注意浏览器限制在 https 或者 localhost 下
|
|
1096
1100
|
* 如果需要指定特殊的媒体设备请单独使用 @see openAudio @see openVideo
|
|
@@ -1135,7 +1139,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
1135
1139
|
* @param minHeight 限制打开设备的高
|
|
1136
1140
|
* @returns @see openUserMedia
|
|
1137
1141
|
*/
|
|
1138
|
-
openCamera(cameraId: string, minWidth?: number, minHeight?: number): Promise<any>;
|
|
1142
|
+
openCamera(cameraId: string, minWidth?: number, minHeight?: number, audio?: boolean, front?: boolean): Promise<any>;
|
|
1139
1143
|
/**
|
|
1140
1144
|
* 请求浏览器打开媒体并且打开上传到服务器通道。
|
|
1141
1145
|
* 要注意的是在服务器连接成功之后请求打开
|
|
@@ -1209,6 +1213,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
1209
1213
|
private taskProcess;
|
|
1210
1214
|
private startProcess;
|
|
1211
1215
|
private onAppStateChange;
|
|
1216
|
+
private onRTCRetrySuccess;
|
|
1212
1217
|
private onGotRemoteStream;
|
|
1213
1218
|
private onGotRemoteAudioStream;
|
|
1214
1219
|
private onCursorStyle;
|
|
@@ -7922,6 +7922,126 @@ export namespace CloudLark {
|
|
|
7922
7922
|
public toJSON(): { [k: string]: any };
|
|
7923
7923
|
}
|
|
7924
7924
|
|
|
7925
|
+
/** Properties of a NotifyFeatures. */
|
|
7926
|
+
interface INotifyFeatures {
|
|
7927
|
+
|
|
7928
|
+
/** NotifyFeatures gamePad */
|
|
7929
|
+
gamePad?: (boolean|null);
|
|
7930
|
+
|
|
7931
|
+
/** NotifyFeatures aivoice */
|
|
7932
|
+
aivoice?: (boolean|null);
|
|
7933
|
+
|
|
7934
|
+
/** NotifyFeatures vcam */
|
|
7935
|
+
vcam?: (boolean|null);
|
|
7936
|
+
|
|
7937
|
+
/** NotifyFeatures rtmp */
|
|
7938
|
+
rtmp?: (boolean|null);
|
|
7939
|
+
|
|
7940
|
+
/** NotifyFeatures audioInput */
|
|
7941
|
+
audioInput?: (boolean|null);
|
|
7942
|
+
|
|
7943
|
+
/** NotifyFeatures offScreen */
|
|
7944
|
+
offScreen?: (boolean|null);
|
|
7945
|
+
}
|
|
7946
|
+
|
|
7947
|
+
/** Represents a NotifyFeatures. */
|
|
7948
|
+
class NotifyFeatures implements INotifyFeatures {
|
|
7949
|
+
|
|
7950
|
+
/**
|
|
7951
|
+
* Constructs a new NotifyFeatures.
|
|
7952
|
+
* @param [properties] Properties to set
|
|
7953
|
+
*/
|
|
7954
|
+
constructor(properties?: CloudLark.INotifyFeatures);
|
|
7955
|
+
|
|
7956
|
+
/** NotifyFeatures gamePad. */
|
|
7957
|
+
public gamePad: boolean;
|
|
7958
|
+
|
|
7959
|
+
/** NotifyFeatures aivoice. */
|
|
7960
|
+
public aivoice: boolean;
|
|
7961
|
+
|
|
7962
|
+
/** NotifyFeatures vcam. */
|
|
7963
|
+
public vcam: boolean;
|
|
7964
|
+
|
|
7965
|
+
/** NotifyFeatures rtmp. */
|
|
7966
|
+
public rtmp: boolean;
|
|
7967
|
+
|
|
7968
|
+
/** NotifyFeatures audioInput. */
|
|
7969
|
+
public audioInput: boolean;
|
|
7970
|
+
|
|
7971
|
+
/** NotifyFeatures offScreen. */
|
|
7972
|
+
public offScreen: boolean;
|
|
7973
|
+
|
|
7974
|
+
/**
|
|
7975
|
+
* Creates a new NotifyFeatures instance using the specified properties.
|
|
7976
|
+
* @param [properties] Properties to set
|
|
7977
|
+
* @returns NotifyFeatures instance
|
|
7978
|
+
*/
|
|
7979
|
+
public static create(properties?: CloudLark.INotifyFeatures): CloudLark.NotifyFeatures;
|
|
7980
|
+
|
|
7981
|
+
/**
|
|
7982
|
+
* Encodes the specified NotifyFeatures message. Does not implicitly {@link CloudLark.NotifyFeatures.verify|verify} messages.
|
|
7983
|
+
* @param message NotifyFeatures message or plain object to encode
|
|
7984
|
+
* @param [writer] Writer to encode to
|
|
7985
|
+
* @returns Writer
|
|
7986
|
+
*/
|
|
7987
|
+
public static encode(message: CloudLark.INotifyFeatures, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
7988
|
+
|
|
7989
|
+
/**
|
|
7990
|
+
* Encodes the specified NotifyFeatures message, length delimited. Does not implicitly {@link CloudLark.NotifyFeatures.verify|verify} messages.
|
|
7991
|
+
* @param message NotifyFeatures message or plain object to encode
|
|
7992
|
+
* @param [writer] Writer to encode to
|
|
7993
|
+
* @returns Writer
|
|
7994
|
+
*/
|
|
7995
|
+
public static encodeDelimited(message: CloudLark.INotifyFeatures, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
7996
|
+
|
|
7997
|
+
/**
|
|
7998
|
+
* Decodes a NotifyFeatures message from the specified reader or buffer.
|
|
7999
|
+
* @param reader Reader or buffer to decode from
|
|
8000
|
+
* @param [length] Message length if known beforehand
|
|
8001
|
+
* @returns NotifyFeatures
|
|
8002
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
8003
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
8004
|
+
*/
|
|
8005
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): CloudLark.NotifyFeatures;
|
|
8006
|
+
|
|
8007
|
+
/**
|
|
8008
|
+
* Decodes a NotifyFeatures message from the specified reader or buffer, length delimited.
|
|
8009
|
+
* @param reader Reader or buffer to decode from
|
|
8010
|
+
* @returns NotifyFeatures
|
|
8011
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
8012
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
8013
|
+
*/
|
|
8014
|
+
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): CloudLark.NotifyFeatures;
|
|
8015
|
+
|
|
8016
|
+
/**
|
|
8017
|
+
* Verifies a NotifyFeatures message.
|
|
8018
|
+
* @param message Plain object to verify
|
|
8019
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
|
8020
|
+
*/
|
|
8021
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
|
8022
|
+
|
|
8023
|
+
/**
|
|
8024
|
+
* Creates a NotifyFeatures message from a plain object. Also converts values to their respective internal types.
|
|
8025
|
+
* @param object Plain object
|
|
8026
|
+
* @returns NotifyFeatures
|
|
8027
|
+
*/
|
|
8028
|
+
public static fromObject(object: { [k: string]: any }): CloudLark.NotifyFeatures;
|
|
8029
|
+
|
|
8030
|
+
/**
|
|
8031
|
+
* Creates a plain object from a NotifyFeatures message. Also converts values to other types if specified.
|
|
8032
|
+
* @param message NotifyFeatures
|
|
8033
|
+
* @param [options] Conversion options
|
|
8034
|
+
* @returns Plain object
|
|
8035
|
+
*/
|
|
8036
|
+
public static toObject(message: CloudLark.NotifyFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
8037
|
+
|
|
8038
|
+
/**
|
|
8039
|
+
* Converts this NotifyFeatures to JSON.
|
|
8040
|
+
* @returns JSON object
|
|
8041
|
+
*/
|
|
8042
|
+
public toJSON(): { [k: string]: any };
|
|
8043
|
+
}
|
|
8044
|
+
|
|
7925
8045
|
/** Properties of an AppNotification. */
|
|
7926
8046
|
interface IAppNotification {
|
|
7927
8047
|
|
|
@@ -7966,6 +8086,9 @@ export namespace CloudLark {
|
|
|
7966
8086
|
|
|
7967
8087
|
/** AppNotification rtmpError */
|
|
7968
8088
|
rtmpError?: (CloudLark.IRtmp_Error|null);
|
|
8089
|
+
|
|
8090
|
+
/** AppNotification notifyFeatures */
|
|
8091
|
+
notifyFeatures?: (CloudLark.INotifyFeatures|null);
|
|
7969
8092
|
}
|
|
7970
8093
|
|
|
7971
8094
|
/** Represents an AppNotification. */
|
|
@@ -8019,8 +8142,11 @@ export namespace CloudLark {
|
|
|
8019
8142
|
/** AppNotification rtmpError. */
|
|
8020
8143
|
public rtmpError?: (CloudLark.IRtmp_Error|null);
|
|
8021
8144
|
|
|
8145
|
+
/** AppNotification notifyFeatures. */
|
|
8146
|
+
public notifyFeatures?: (CloudLark.INotifyFeatures|null);
|
|
8147
|
+
|
|
8022
8148
|
/** AppNotification notify. */
|
|
8023
|
-
public notify?: ("resize"|"mousemode"|"updatePlayers"|"requestInput"|"gamepadOutput"|"datachannelState"|"appDcMsg"|"cursorStyle"|"aiVoiceRealtimeParseresult"|"aiVoiceResult"|"aiVoiceServiceStatus"|"aiVoiceErr"|"rtmpState"|"rtmpError");
|
|
8149
|
+
public notify?: ("resize"|"mousemode"|"updatePlayers"|"requestInput"|"gamepadOutput"|"datachannelState"|"appDcMsg"|"cursorStyle"|"aiVoiceRealtimeParseresult"|"aiVoiceResult"|"aiVoiceServiceStatus"|"aiVoiceErr"|"rtmpState"|"rtmpError"|"notifyFeatures");
|
|
8024
8150
|
|
|
8025
8151
|
/**
|
|
8026
8152
|
* Creates a new AppNotification instance using the specified properties.
|
|
@@ -111,6 +111,8 @@ export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEven
|
|
|
111
111
|
private larksr;
|
|
112
112
|
get baseElementScale(): number;
|
|
113
113
|
private _baseElementScale;
|
|
114
|
+
get wechatFullScreen(): boolean;
|
|
115
|
+
private _wechatFullScreen;
|
|
114
116
|
constructor(rootElement: HTMLElement, params: IAppliParams, larksr: LarkSR, handleRootElementSize?: boolean, onlyHandleRootElementTransform?: boolean);
|
|
115
117
|
reset(params: IAppliParams): void;
|
|
116
118
|
setMobileForceLandScape(force: boolean): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larksr_websdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.341",
|
|
4
4
|
"description": "Larksr websdk. Easy to build a cloud render client for larksr system or ue4 pixelstreaming.docs: https://pingxingyun.github.io/webclient_sdk/",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pingxingyun",
|
|
@@ -44,7 +44,8 @@ export declare enum APP_EVENT_TYPE {
|
|
|
44
44
|
AI_VOICE_DM_RESULT = 20,
|
|
45
45
|
AI_VOICE_ERROR = 21,
|
|
46
46
|
RTMP_STREAM_STATE = 22,
|
|
47
|
-
RTMP_STREAM_ERROR = 23
|
|
47
|
+
RTMP_STREAM_ERROR = 23,
|
|
48
|
+
RTC_RETRY_SUCCESS = 24
|
|
48
49
|
}
|
|
49
50
|
export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
|
|
50
51
|
data?: any;
|
|
@@ -66,6 +67,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
66
67
|
get videoTrack(): MediaStreamTrack | null | undefined;
|
|
67
68
|
get audioPaused(): boolean | undefined;
|
|
68
69
|
get videoPaused(): boolean | undefined;
|
|
70
|
+
get serverFeatures(): Msg.CloudLark.INotifyFeatures | null | undefined;
|
|
69
71
|
private get sharePeerConnection();
|
|
70
72
|
private retryTime;
|
|
71
73
|
private larksr;
|
|
@@ -146,7 +148,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
146
148
|
closeVideo(): any;
|
|
147
149
|
closeShare(): any;
|
|
148
150
|
openAudio(deviceId?: string): Promise<any>;
|
|
149
|
-
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<any>;
|
|
151
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number, front?: boolean): Promise<any>;
|
|
150
152
|
openDefaultMedia(video?: boolean, audio?: boolean): Promise<any>;
|
|
151
153
|
openShareMediaDevice(): Promise<any>;
|
|
152
154
|
getConnectedAudioinputDevices(): Promise<any>;
|
|
@@ -154,7 +156,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
154
156
|
getConnectedVideoinputDevices(): Promise<any>;
|
|
155
157
|
getConnectedDevices(type: MediaDeviceKind): Promise<any>;
|
|
156
158
|
openAudioDevice(deviceId: string, kind?: "audioinput" | "audiooutput"): Promise<any>;
|
|
157
|
-
openCamera(cameraId: string, minWidth?: number, minHeight?: number): Promise<any>;
|
|
159
|
+
openCamera(cameraId: string, minWidth?: number, minHeight?: number, audio?: boolean, front?: boolean): Promise<any>;
|
|
158
160
|
openUserMeida(constraints?: MediaStreamConstraints, reset?: boolean): Promise<any>;
|
|
159
161
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean | undefined;
|
|
160
162
|
removeMediaTrack(track: RTCRtpSender): any;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import ScreenState from '@/screen_state';
|
|
2
|
+
export default class CanvasRender {
|
|
3
|
+
get canvas(): HTMLCanvasElement | null;
|
|
4
|
+
private set canvas(value);
|
|
5
|
+
private _canvas;
|
|
6
|
+
private context;
|
|
7
|
+
private width;
|
|
8
|
+
private height;
|
|
9
|
+
private video;
|
|
10
|
+
private drawFrames;
|
|
11
|
+
private stream;
|
|
12
|
+
private screenState;
|
|
13
|
+
private hasDeviceOrientationEvent;
|
|
14
|
+
private alpha;
|
|
15
|
+
private beta;
|
|
16
|
+
private gamma;
|
|
17
|
+
private isFront;
|
|
18
|
+
private currentRotateClock;
|
|
19
|
+
constructor(screenState: ScreenState);
|
|
20
|
+
init(stream: MediaStream): Promise<HTMLCanvasElement>;
|
|
21
|
+
draw(): void;
|
|
22
|
+
stopDrawing(): void;
|
|
23
|
+
clear(): void;
|
|
24
|
+
setRotate(clock: boolean): void;
|
|
25
|
+
clearRotate(): void;
|
|
26
|
+
setupRotateWithDeivce(): void;
|
|
27
|
+
private checkFront;
|
|
28
|
+
}
|
|
@@ -30,7 +30,7 @@ export interface MediaShareInterface {
|
|
|
30
30
|
closeVideo(): any;
|
|
31
31
|
closeShare(): any;
|
|
32
32
|
openAudio(deviceId: string): Promise<any>;
|
|
33
|
-
openVideo(audio: boolean, cameraId: string, width: number, height: number): Promise<any>;
|
|
33
|
+
openVideo(audio: boolean, cameraId: string, width: number, height: number, front?: boolean): Promise<any>;
|
|
34
34
|
openDefaultMedia(video: boolean, audio: boolean): Promise<any>;
|
|
35
35
|
openShareMediaDevice(): Promise<any>;
|
|
36
36
|
getConnectedAudioinputDevices(): Promise<any>;
|
|
@@ -38,7 +38,7 @@ export interface MediaShareInterface {
|
|
|
38
38
|
getConnectedVideoinputDevices(): Promise<any>;
|
|
39
39
|
getConnectedDevices(type: MediaDeviceKind): Promise<any>;
|
|
40
40
|
openAudioDevice(deviceId: string, kind: "audioinput" | "audiooutput"): Promise<any>;
|
|
41
|
-
openCamera(cameraId: string, minWidth: number, minHeight: number): Promise<any>;
|
|
41
|
+
openCamera(cameraId: string, minWidth: number, minHeight: number, audio: boolean, front?: boolean): Promise<any>;
|
|
42
42
|
openUserMeida(constraints?: MediaStreamConstraints, reset?: boolean): Promise<any>;
|
|
43
43
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean;
|
|
44
44
|
removeMediaTrack(track: RTCRtpSender): any;
|
|
@@ -106,6 +106,9 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
106
106
|
private videoBinding;
|
|
107
107
|
private readonly sendStream;
|
|
108
108
|
private sdpCreateSuccess;
|
|
109
|
+
private canvasRender;
|
|
110
|
+
get serverFeatures(): CloudLark.INotifyFeatures | null;
|
|
111
|
+
private _serverFeatures;
|
|
109
112
|
constructor(larksr: LarkSR, config: WebRTCConfig);
|
|
110
113
|
create(streams?: MediaStream | undefined | null, config?: CloudLark.IRTCConfiguration | null | undefined): Promise<void>;
|
|
111
114
|
createOffer(): void;
|
|
@@ -128,7 +131,7 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
128
131
|
streams: MediaStream;
|
|
129
132
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
130
133
|
}>;
|
|
131
|
-
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<{
|
|
134
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number, front?: boolean): Promise<{
|
|
132
135
|
streams: MediaStream;
|
|
133
136
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
134
137
|
}>;
|
|
@@ -145,7 +148,7 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
145
148
|
streams: MediaStream;
|
|
146
149
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
147
150
|
}>;
|
|
148
|
-
openCamera(cameraId: string, width?: number, height?: number, audio?: boolean): Promise<{
|
|
151
|
+
openCamera(cameraId: string, width?: number, height?: number, audio?: boolean, front?: boolean): Promise<{
|
|
149
152
|
streams: MediaStream;
|
|
150
153
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
151
154
|
}>;
|
|
@@ -33,6 +33,7 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
33
33
|
private videoBinding;
|
|
34
34
|
private sdpCreateSuccess;
|
|
35
35
|
private readonly sendStream;
|
|
36
|
+
private canvasRender;
|
|
36
37
|
constructor(larksr: LarkSR);
|
|
37
38
|
create(config?: CloudLark.IRTCConfiguration | null | undefined): Promise<void>;
|
|
38
39
|
createOffer(): void;
|
|
@@ -55,7 +56,7 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
55
56
|
streams: MediaStream;
|
|
56
57
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
57
58
|
}>;
|
|
58
|
-
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<{
|
|
59
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number, front?: boolean): Promise<{
|
|
59
60
|
streams: MediaStream;
|
|
60
61
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
61
62
|
}>;
|
|
@@ -72,7 +73,7 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
72
73
|
streams: MediaStream;
|
|
73
74
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
74
75
|
}>;
|
|
75
|
-
openCamera(cameraId: string, width?: number, height?: number, audio?: boolean): Promise<{
|
|
76
|
+
openCamera(cameraId: string, width?: number, height?: number, audio?: boolean, front?: boolean): Promise<{
|
|
76
77
|
streams: MediaStream;
|
|
77
78
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
78
79
|
}>;
|
package/types/larksr.d.ts
CHANGED
|
@@ -647,6 +647,10 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
647
647
|
* 视频通道是否暂停
|
|
648
648
|
*/
|
|
649
649
|
get videoPaused(): boolean | undefined;
|
|
650
|
+
/**
|
|
651
|
+
* 服务器支持的功能列表
|
|
652
|
+
*/
|
|
653
|
+
get serverFeatures(): CloudLark.INotifyFeatures | null | undefined;
|
|
650
654
|
/**
|
|
651
655
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
652
656
|
* @param config 本地配置,优先级最高
|
|
@@ -1090,7 +1094,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
1090
1094
|
* @param cameraId 视频设备id,如果不传将打开默认设备。@see getConnectedVideoinputDevices
|
|
1091
1095
|
* @returns Promise
|
|
1092
1096
|
*/
|
|
1093
|
-
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<any>;
|
|
1097
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number, front?: boolean): Promise<any>;
|
|
1094
1098
|
/**
|
|
1095
1099
|
* 打开默认媒体设备,要注意浏览器限制在 https 或者 localhost 下
|
|
1096
1100
|
* 如果需要指定特殊的媒体设备请单独使用 @see openAudio @see openVideo
|
|
@@ -1135,7 +1139,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
1135
1139
|
* @param minHeight 限制打开设备的高
|
|
1136
1140
|
* @returns @see openUserMedia
|
|
1137
1141
|
*/
|
|
1138
|
-
openCamera(cameraId: string, minWidth?: number, minHeight?: number): Promise<any>;
|
|
1142
|
+
openCamera(cameraId: string, minWidth?: number, minHeight?: number, audio?: boolean, front?: boolean): Promise<any>;
|
|
1139
1143
|
/**
|
|
1140
1144
|
* 请求浏览器打开媒体并且打开上传到服务器通道。
|
|
1141
1145
|
* 要注意的是在服务器连接成功之后请求打开
|
|
@@ -1209,6 +1213,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
1209
1213
|
private taskProcess;
|
|
1210
1214
|
private startProcess;
|
|
1211
1215
|
private onAppStateChange;
|
|
1216
|
+
private onRTCRetrySuccess;
|
|
1212
1217
|
private onGotRemoteStream;
|
|
1213
1218
|
private onGotRemoteAudioStream;
|
|
1214
1219
|
private onCursorStyle;
|
|
@@ -7922,6 +7922,126 @@ export namespace CloudLark {
|
|
|
7922
7922
|
public toJSON(): { [k: string]: any };
|
|
7923
7923
|
}
|
|
7924
7924
|
|
|
7925
|
+
/** Properties of a NotifyFeatures. */
|
|
7926
|
+
interface INotifyFeatures {
|
|
7927
|
+
|
|
7928
|
+
/** NotifyFeatures gamePad */
|
|
7929
|
+
gamePad?: (boolean|null);
|
|
7930
|
+
|
|
7931
|
+
/** NotifyFeatures aivoice */
|
|
7932
|
+
aivoice?: (boolean|null);
|
|
7933
|
+
|
|
7934
|
+
/** NotifyFeatures vcam */
|
|
7935
|
+
vcam?: (boolean|null);
|
|
7936
|
+
|
|
7937
|
+
/** NotifyFeatures rtmp */
|
|
7938
|
+
rtmp?: (boolean|null);
|
|
7939
|
+
|
|
7940
|
+
/** NotifyFeatures audioInput */
|
|
7941
|
+
audioInput?: (boolean|null);
|
|
7942
|
+
|
|
7943
|
+
/** NotifyFeatures offScreen */
|
|
7944
|
+
offScreen?: (boolean|null);
|
|
7945
|
+
}
|
|
7946
|
+
|
|
7947
|
+
/** Represents a NotifyFeatures. */
|
|
7948
|
+
class NotifyFeatures implements INotifyFeatures {
|
|
7949
|
+
|
|
7950
|
+
/**
|
|
7951
|
+
* Constructs a new NotifyFeatures.
|
|
7952
|
+
* @param [properties] Properties to set
|
|
7953
|
+
*/
|
|
7954
|
+
constructor(properties?: CloudLark.INotifyFeatures);
|
|
7955
|
+
|
|
7956
|
+
/** NotifyFeatures gamePad. */
|
|
7957
|
+
public gamePad: boolean;
|
|
7958
|
+
|
|
7959
|
+
/** NotifyFeatures aivoice. */
|
|
7960
|
+
public aivoice: boolean;
|
|
7961
|
+
|
|
7962
|
+
/** NotifyFeatures vcam. */
|
|
7963
|
+
public vcam: boolean;
|
|
7964
|
+
|
|
7965
|
+
/** NotifyFeatures rtmp. */
|
|
7966
|
+
public rtmp: boolean;
|
|
7967
|
+
|
|
7968
|
+
/** NotifyFeatures audioInput. */
|
|
7969
|
+
public audioInput: boolean;
|
|
7970
|
+
|
|
7971
|
+
/** NotifyFeatures offScreen. */
|
|
7972
|
+
public offScreen: boolean;
|
|
7973
|
+
|
|
7974
|
+
/**
|
|
7975
|
+
* Creates a new NotifyFeatures instance using the specified properties.
|
|
7976
|
+
* @param [properties] Properties to set
|
|
7977
|
+
* @returns NotifyFeatures instance
|
|
7978
|
+
*/
|
|
7979
|
+
public static create(properties?: CloudLark.INotifyFeatures): CloudLark.NotifyFeatures;
|
|
7980
|
+
|
|
7981
|
+
/**
|
|
7982
|
+
* Encodes the specified NotifyFeatures message. Does not implicitly {@link CloudLark.NotifyFeatures.verify|verify} messages.
|
|
7983
|
+
* @param message NotifyFeatures message or plain object to encode
|
|
7984
|
+
* @param [writer] Writer to encode to
|
|
7985
|
+
* @returns Writer
|
|
7986
|
+
*/
|
|
7987
|
+
public static encode(message: CloudLark.INotifyFeatures, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
7988
|
+
|
|
7989
|
+
/**
|
|
7990
|
+
* Encodes the specified NotifyFeatures message, length delimited. Does not implicitly {@link CloudLark.NotifyFeatures.verify|verify} messages.
|
|
7991
|
+
* @param message NotifyFeatures message or plain object to encode
|
|
7992
|
+
* @param [writer] Writer to encode to
|
|
7993
|
+
* @returns Writer
|
|
7994
|
+
*/
|
|
7995
|
+
public static encodeDelimited(message: CloudLark.INotifyFeatures, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
7996
|
+
|
|
7997
|
+
/**
|
|
7998
|
+
* Decodes a NotifyFeatures message from the specified reader or buffer.
|
|
7999
|
+
* @param reader Reader or buffer to decode from
|
|
8000
|
+
* @param [length] Message length if known beforehand
|
|
8001
|
+
* @returns NotifyFeatures
|
|
8002
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
8003
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
8004
|
+
*/
|
|
8005
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): CloudLark.NotifyFeatures;
|
|
8006
|
+
|
|
8007
|
+
/**
|
|
8008
|
+
* Decodes a NotifyFeatures message from the specified reader or buffer, length delimited.
|
|
8009
|
+
* @param reader Reader or buffer to decode from
|
|
8010
|
+
* @returns NotifyFeatures
|
|
8011
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
8012
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
8013
|
+
*/
|
|
8014
|
+
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): CloudLark.NotifyFeatures;
|
|
8015
|
+
|
|
8016
|
+
/**
|
|
8017
|
+
* Verifies a NotifyFeatures message.
|
|
8018
|
+
* @param message Plain object to verify
|
|
8019
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
|
8020
|
+
*/
|
|
8021
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
|
8022
|
+
|
|
8023
|
+
/**
|
|
8024
|
+
* Creates a NotifyFeatures message from a plain object. Also converts values to their respective internal types.
|
|
8025
|
+
* @param object Plain object
|
|
8026
|
+
* @returns NotifyFeatures
|
|
8027
|
+
*/
|
|
8028
|
+
public static fromObject(object: { [k: string]: any }): CloudLark.NotifyFeatures;
|
|
8029
|
+
|
|
8030
|
+
/**
|
|
8031
|
+
* Creates a plain object from a NotifyFeatures message. Also converts values to other types if specified.
|
|
8032
|
+
* @param message NotifyFeatures
|
|
8033
|
+
* @param [options] Conversion options
|
|
8034
|
+
* @returns Plain object
|
|
8035
|
+
*/
|
|
8036
|
+
public static toObject(message: CloudLark.NotifyFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
8037
|
+
|
|
8038
|
+
/**
|
|
8039
|
+
* Converts this NotifyFeatures to JSON.
|
|
8040
|
+
* @returns JSON object
|
|
8041
|
+
*/
|
|
8042
|
+
public toJSON(): { [k: string]: any };
|
|
8043
|
+
}
|
|
8044
|
+
|
|
7925
8045
|
/** Properties of an AppNotification. */
|
|
7926
8046
|
interface IAppNotification {
|
|
7927
8047
|
|
|
@@ -7966,6 +8086,9 @@ export namespace CloudLark {
|
|
|
7966
8086
|
|
|
7967
8087
|
/** AppNotification rtmpError */
|
|
7968
8088
|
rtmpError?: (CloudLark.IRtmp_Error|null);
|
|
8089
|
+
|
|
8090
|
+
/** AppNotification notifyFeatures */
|
|
8091
|
+
notifyFeatures?: (CloudLark.INotifyFeatures|null);
|
|
7969
8092
|
}
|
|
7970
8093
|
|
|
7971
8094
|
/** Represents an AppNotification. */
|
|
@@ -8019,8 +8142,11 @@ export namespace CloudLark {
|
|
|
8019
8142
|
/** AppNotification rtmpError. */
|
|
8020
8143
|
public rtmpError?: (CloudLark.IRtmp_Error|null);
|
|
8021
8144
|
|
|
8145
|
+
/** AppNotification notifyFeatures. */
|
|
8146
|
+
public notifyFeatures?: (CloudLark.INotifyFeatures|null);
|
|
8147
|
+
|
|
8022
8148
|
/** AppNotification notify. */
|
|
8023
|
-
public notify?: ("resize"|"mousemode"|"updatePlayers"|"requestInput"|"gamepadOutput"|"datachannelState"|"appDcMsg"|"cursorStyle"|"aiVoiceRealtimeParseresult"|"aiVoiceResult"|"aiVoiceServiceStatus"|"aiVoiceErr"|"rtmpState"|"rtmpError");
|
|
8149
|
+
public notify?: ("resize"|"mousemode"|"updatePlayers"|"requestInput"|"gamepadOutput"|"datachannelState"|"appDcMsg"|"cursorStyle"|"aiVoiceRealtimeParseresult"|"aiVoiceResult"|"aiVoiceServiceStatus"|"aiVoiceErr"|"rtmpState"|"rtmpError"|"notifyFeatures");
|
|
8024
8150
|
|
|
8025
8151
|
/**
|
|
8026
8152
|
* Creates a new AppNotification instance using the specified properties.
|