@flashphoner/websdk 2.0.216 → 2.0.219
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/docTemplate/README.md +1 -1
- package/examples/demo/streaming/conference/conference.js +9 -1
- package/examples/demo/streaming/player/player.js +12 -2
- package/examples/demo/streaming/stream-snapshot/stream-snapshot.js +11 -11
- package/examples/demo/streaming/video-chat-and-screen-sharing/video-chat-and-screen-sharing.js +12 -0
- package/flashphoner-no-flash.js +840 -590
- package/flashphoner-no-flash.min.js +1 -1
- package/flashphoner-no-webrtc.js +840 -590
- package/flashphoner-no-webrtc.min.js +1 -1
- package/flashphoner-no-wsplayer.js +840 -590
- package/flashphoner-no-wsplayer.min.js +1 -1
- package/flashphoner-room-api.js +819 -697
- package/flashphoner-room-api.min.js +1 -1
- package/flashphoner-temasys-flash-websocket-without-adapterjs.js +840 -590
- package/flashphoner-temasys-flash-websocket.js +840 -590
- package/flashphoner-temasys-flash-websocket.min.js +1 -1
- package/flashphoner-webrtc-only.js +839 -589
- package/flashphoner-webrtc-only.min.js +1 -1
- package/flashphoner.js +840 -590
- package/flashphoner.min.js +1 -1
- package/package.json +1 -1
- package/src/constants.d.ts +792 -1
- package/src/constants.js +817 -704
- package/src/flashphoner-core.d.ts +359 -212
- package/src/flashphoner-core.js +10 -1
- package/src/media-source-media-provider.js +1 -1
- package/src/room-module.d.ts +2 -2
|
@@ -1,212 +1,359 @@
|
|
|
1
|
-
export declare class Call {
|
|
2
|
-
call: () => void;
|
|
3
|
-
answer: (answerOptions: {
|
|
4
|
-
localVideoDisplay: HTMLElement;
|
|
5
|
-
remoteVideoDisplay: HTMLElement;
|
|
6
|
-
receiveAudio?: boolean | undefined;
|
|
7
|
-
receiveVideo?: boolean | undefined;
|
|
8
|
-
constraints?: string | undefined;
|
|
9
|
-
stripCodecs?: string | undefined;
|
|
10
|
-
sipSDP?: Array<string> | undefined;
|
|
11
|
-
sipHeaders?: Array<string> | undefined;
|
|
12
|
-
}) => void;
|
|
13
|
-
hangup: () => void;
|
|
14
|
-
id: () => string;
|
|
15
|
-
getInfo: () => string;
|
|
16
|
-
getErrorInfo: () => string;
|
|
17
|
-
status: () => string;
|
|
18
|
-
getStats: (callbackFn: any, nativeStats: boolean) => any;
|
|
19
|
-
setAudioOutputId: (id: string) => any;
|
|
20
|
-
setVolume: (volume: number) => void;
|
|
21
|
-
getVolume: () => number;
|
|
22
|
-
muteAudio: () => void;
|
|
23
|
-
unmuteAudio: () => void;
|
|
24
|
-
isVideoMuted: () => boolean;
|
|
25
|
-
caller: () => string;
|
|
26
|
-
callee: () => string;
|
|
27
|
-
visibleName: () => string;
|
|
28
|
-
hold: () => void;
|
|
29
|
-
holdForTransfer: () => void;
|
|
30
|
-
unhold: () => void;
|
|
31
|
-
sendDTMF: (number: number, type?: string | undefined) => void;
|
|
32
|
-
transfer: (target: any) => void;
|
|
33
|
-
on: (event: string, callback: any) => Call;
|
|
34
|
-
switchCam: (deviceId: any) => any;
|
|
35
|
-
switchMic: (deviceId: any) => any;
|
|
36
|
-
switchToScreen: (source: string, woExtension: boolean) => any;
|
|
37
|
-
switchToCam: () => void;
|
|
38
|
-
getLogger: () => any;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export declare class Stream {
|
|
42
|
-
play: () => void;
|
|
43
|
-
publish: () => void;
|
|
44
|
-
stop: () => void;
|
|
45
|
-
id: () => string;
|
|
46
|
-
status: () => string;
|
|
47
|
-
name: () => string;
|
|
48
|
-
published: () => boolean;
|
|
49
|
-
getRecordInfo: () => string;
|
|
50
|
-
getInfo: () => string;
|
|
51
|
-
getErrorInfo: () => string;
|
|
52
|
-
videoResolution: () => any;
|
|
53
|
-
setAudioOutputId: (id: string) => any;
|
|
54
|
-
setVolume: (volume: number) => void;
|
|
55
|
-
unmuteRemoteAudio: () => void;
|
|
56
|
-
muteRemoteAudio: () => void;
|
|
57
|
-
isRemoteAudioMuted: () => boolean;
|
|
58
|
-
setMicrophoneGain: (volume: number) => void;
|
|
59
|
-
getVolume: () => number;
|
|
60
|
-
muteAudio: () => void;
|
|
61
|
-
unmuteAudio: () => void;
|
|
62
|
-
isAudioMuted: () => boolean;
|
|
63
|
-
muteVideo: () => void;
|
|
64
|
-
unmuteVideo: () => void;
|
|
65
|
-
isVideoMuted: () => boolean;
|
|
66
|
-
getStats: (callbackFn: any, nativeStats: boolean) => any;
|
|
67
|
-
snapshot: () => void;
|
|
68
|
-
getAudioState: () => any;
|
|
69
|
-
getVideoState: () => any;
|
|
70
|
-
getNetworkBandwidth: () => number;
|
|
71
|
-
getRemoteBitrate: () => number;
|
|
72
|
-
fullScreen: () => void;
|
|
73
|
-
on: (event: string, callback: any) => Stream;
|
|
74
|
-
available: () => any;
|
|
75
|
-
switchCam: (deviceId: any) => any;
|
|
76
|
-
switchMic: (deviceId: any) => any;
|
|
77
|
-
switchToScreen: (source: string, woExtension: boolean) => any;
|
|
78
|
-
switchToCam: () => void;
|
|
79
|
-
sendData: (payload: any) => void;
|
|
80
|
-
getLogger: () => any;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export declare class Session {
|
|
84
|
-
id: () => string;
|
|
85
|
-
status: () => string;
|
|
86
|
-
getServerUrl: () => string;
|
|
87
|
-
createStream: (options: {
|
|
88
|
-
name: string;
|
|
89
|
-
constraints?: any | undefined;
|
|
90
|
-
mediaProvider: string;
|
|
91
|
-
receiveAudio?: boolean | undefined;
|
|
92
|
-
receiveVideo?: boolean | undefined;
|
|
93
|
-
cacheLocalResources?: boolean | undefined;
|
|
94
|
-
playWidth?: number | undefined;
|
|
95
|
-
playHeight?: number | undefined;
|
|
96
|
-
record?: boolean | undefined;
|
|
97
|
-
display: any;
|
|
98
|
-
custom?: any | undefined;
|
|
99
|
-
stripCodecs?: string | undefined;
|
|
100
|
-
rtmpUrl?: string | undefined;
|
|
101
|
-
mediaConnectionConstraints?: any | undefined;
|
|
102
|
-
flashShowFullScreenButton?: boolean | undefined;
|
|
103
|
-
transport?: string | undefined;
|
|
104
|
-
cvoExtension?: boolean | undefined;
|
|
105
|
-
playoutDelay?: number | undefined;
|
|
106
|
-
useCanvasMediaStream?: boolean | undefined;
|
|
107
|
-
videoContentHint?: string | undefined;
|
|
108
|
-
unmutePlayOnStart?: boolean | undefined;
|
|
109
|
-
sdpHook?: any | undefined
|
|
110
|
-
logger?: any | undefined;
|
|
111
|
-
}) => Stream;
|
|
112
|
-
createCall: (options: {
|
|
113
|
-
callee: string;
|
|
114
|
-
visibleName?: string | undefined;
|
|
115
|
-
constraints?: any | undefined;
|
|
116
|
-
mediaProvider: string;
|
|
117
|
-
receiveAudio?: boolean | undefined;
|
|
118
|
-
receiveVideo?: boolean | undefined;
|
|
119
|
-
cacheLocalResources?: boolean | undefined;
|
|
120
|
-
localVideoDisplay: HTMLElement;
|
|
121
|
-
remoteVideoDisplay: HTMLElement;
|
|
122
|
-
custom?: any | undefined;
|
|
123
|
-
stripCodecs?: string | undefined;
|
|
124
|
-
sipSDP?: Array<string> | undefined;
|
|
125
|
-
sipHeaders?: Array<string> | undefined;
|
|
126
|
-
videoContentHint?: string | undefined;
|
|
127
|
-
toStream?: string | undefined;
|
|
128
|
-
logger?: any | undefined;
|
|
129
|
-
}) => Call;
|
|
130
|
-
getStream: (streamId: string) => any;
|
|
131
|
-
getStreams: () => any[];
|
|
132
|
-
sendData: (data: any) => any;
|
|
133
|
-
disconnect: () => void;
|
|
134
|
-
submitBugReport: (reportObject: any) => void;
|
|
135
|
-
startDebug: () => void;
|
|
136
|
-
stopDebug: () => void;
|
|
137
|
-
on: (event: string, callback: any) => Session;
|
|
138
|
-
getLogger: () => any;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
export function
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
1
|
+
export declare class Call {
|
|
2
|
+
call: () => void;
|
|
3
|
+
answer: (answerOptions: {
|
|
4
|
+
localVideoDisplay: HTMLElement;
|
|
5
|
+
remoteVideoDisplay: HTMLElement;
|
|
6
|
+
receiveAudio?: boolean | undefined;
|
|
7
|
+
receiveVideo?: boolean | undefined;
|
|
8
|
+
constraints?: string | undefined;
|
|
9
|
+
stripCodecs?: string | undefined;
|
|
10
|
+
sipSDP?: Array<string> | undefined;
|
|
11
|
+
sipHeaders?: Array<string> | undefined;
|
|
12
|
+
}) => void;
|
|
13
|
+
hangup: () => void;
|
|
14
|
+
id: () => string;
|
|
15
|
+
getInfo: () => string;
|
|
16
|
+
getErrorInfo: () => string;
|
|
17
|
+
status: () => string;
|
|
18
|
+
getStats: (callbackFn: any, nativeStats: boolean) => any;
|
|
19
|
+
setAudioOutputId: (id: string) => any;
|
|
20
|
+
setVolume: (volume: number) => void;
|
|
21
|
+
getVolume: () => number;
|
|
22
|
+
muteAudio: () => void;
|
|
23
|
+
unmuteAudio: () => void;
|
|
24
|
+
isVideoMuted: () => boolean;
|
|
25
|
+
caller: () => string;
|
|
26
|
+
callee: () => string;
|
|
27
|
+
visibleName: () => string;
|
|
28
|
+
hold: () => void;
|
|
29
|
+
holdForTransfer: () => void;
|
|
30
|
+
unhold: () => void;
|
|
31
|
+
sendDTMF: (number: number, type?: string | undefined) => void;
|
|
32
|
+
transfer: (target: any) => void;
|
|
33
|
+
on: (event: string, callback: any) => Call;
|
|
34
|
+
switchCam: (deviceId: any) => any;
|
|
35
|
+
switchMic: (deviceId: any) => any;
|
|
36
|
+
switchToScreen: (source: string, woExtension: boolean) => any;
|
|
37
|
+
switchToCam: () => void;
|
|
38
|
+
getLogger: () => any;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare class Stream {
|
|
42
|
+
play: () => void;
|
|
43
|
+
publish: () => void;
|
|
44
|
+
stop: () => void;
|
|
45
|
+
id: () => string;
|
|
46
|
+
status: () => string;
|
|
47
|
+
name: () => string;
|
|
48
|
+
published: () => boolean;
|
|
49
|
+
getRecordInfo: () => string;
|
|
50
|
+
getInfo: () => string;
|
|
51
|
+
getErrorInfo: () => string;
|
|
52
|
+
videoResolution: () => any;
|
|
53
|
+
setAudioOutputId: (id: string) => any;
|
|
54
|
+
setVolume: (volume: number) => void;
|
|
55
|
+
unmuteRemoteAudio: () => void;
|
|
56
|
+
muteRemoteAudio: () => void;
|
|
57
|
+
isRemoteAudioMuted: () => boolean;
|
|
58
|
+
setMicrophoneGain: (volume: number) => void;
|
|
59
|
+
getVolume: () => number;
|
|
60
|
+
muteAudio: () => void;
|
|
61
|
+
unmuteAudio: () => void;
|
|
62
|
+
isAudioMuted: () => boolean;
|
|
63
|
+
muteVideo: () => void;
|
|
64
|
+
unmuteVideo: () => void;
|
|
65
|
+
isVideoMuted: () => boolean;
|
|
66
|
+
getStats: (callbackFn: any, nativeStats: boolean) => any;
|
|
67
|
+
snapshot: () => void;
|
|
68
|
+
getAudioState: () => any;
|
|
69
|
+
getVideoState: () => any;
|
|
70
|
+
getNetworkBandwidth: () => number;
|
|
71
|
+
getRemoteBitrate: () => number;
|
|
72
|
+
fullScreen: () => void;
|
|
73
|
+
on: (event: string, callback: any) => Stream;
|
|
74
|
+
available: () => any;
|
|
75
|
+
switchCam: (deviceId: any) => any;
|
|
76
|
+
switchMic: (deviceId: any) => any;
|
|
77
|
+
switchToScreen: (source: string, woExtension: boolean) => any;
|
|
78
|
+
switchToCam: () => void;
|
|
79
|
+
sendData: (payload: any) => void;
|
|
80
|
+
getLogger: () => any;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export declare class Session {
|
|
84
|
+
id: () => string;
|
|
85
|
+
status: () => string;
|
|
86
|
+
getServerUrl: () => string;
|
|
87
|
+
createStream: (options: {
|
|
88
|
+
name: string;
|
|
89
|
+
constraints?: any | undefined;
|
|
90
|
+
mediaProvider: string;
|
|
91
|
+
receiveAudio?: boolean | undefined;
|
|
92
|
+
receiveVideo?: boolean | undefined;
|
|
93
|
+
cacheLocalResources?: boolean | undefined;
|
|
94
|
+
playWidth?: number | undefined;
|
|
95
|
+
playHeight?: number | undefined;
|
|
96
|
+
record?: boolean | undefined;
|
|
97
|
+
display: any;
|
|
98
|
+
custom?: any | undefined;
|
|
99
|
+
stripCodecs?: string | undefined;
|
|
100
|
+
rtmpUrl?: string | undefined;
|
|
101
|
+
mediaConnectionConstraints?: any | undefined;
|
|
102
|
+
flashShowFullScreenButton?: boolean | undefined;
|
|
103
|
+
transport?: string | undefined;
|
|
104
|
+
cvoExtension?: boolean | undefined;
|
|
105
|
+
playoutDelay?: number | undefined;
|
|
106
|
+
useCanvasMediaStream?: boolean | undefined;
|
|
107
|
+
videoContentHint?: string | undefined;
|
|
108
|
+
unmutePlayOnStart?: boolean | undefined;
|
|
109
|
+
sdpHook?: any | undefined
|
|
110
|
+
logger?: any | undefined;
|
|
111
|
+
}) => Stream;
|
|
112
|
+
createCall: (options: {
|
|
113
|
+
callee: string;
|
|
114
|
+
visibleName?: string | undefined;
|
|
115
|
+
constraints?: any | undefined;
|
|
116
|
+
mediaProvider: string;
|
|
117
|
+
receiveAudio?: boolean | undefined;
|
|
118
|
+
receiveVideo?: boolean | undefined;
|
|
119
|
+
cacheLocalResources?: boolean | undefined;
|
|
120
|
+
localVideoDisplay: HTMLElement;
|
|
121
|
+
remoteVideoDisplay: HTMLElement;
|
|
122
|
+
custom?: any | undefined;
|
|
123
|
+
stripCodecs?: string | undefined;
|
|
124
|
+
sipSDP?: Array<string> | undefined;
|
|
125
|
+
sipHeaders?: Array<string> | undefined;
|
|
126
|
+
videoContentHint?: string | undefined;
|
|
127
|
+
toStream?: string | undefined;
|
|
128
|
+
logger?: any | undefined;
|
|
129
|
+
}) => Call;
|
|
130
|
+
getStream: (streamId: string) => any;
|
|
131
|
+
getStreams: () => any[];
|
|
132
|
+
sendData: (data: any) => any;
|
|
133
|
+
disconnect: () => void;
|
|
134
|
+
submitBugReport: (reportObject: any) => void;
|
|
135
|
+
startDebug: () => void;
|
|
136
|
+
stopDebug: () => void;
|
|
137
|
+
on: (event: string, callback: any) => Session;
|
|
138
|
+
getLogger: () => any;
|
|
139
|
+
}
|
|
140
|
+
export function sendData(data: any): Promise<any>;
|
|
141
|
+
export function resolveData(data: any): void;
|
|
142
|
+
/**
|
|
143
|
+
* Static initializer.
|
|
144
|
+
*
|
|
145
|
+
* @param {Object} options Global api options
|
|
146
|
+
* @param {Function=} options.mediaProvidersReadyCallback Callback of initialized WebRTC Plugin
|
|
147
|
+
* @param {String=} options.flashMediaProviderSwfLocation Location of media-provider.swf file
|
|
148
|
+
* @param {string=} options.preferredMediaProvider DEPRECATED: Use preferred media provider if available
|
|
149
|
+
* @param {Array=} options.preferredMediaProviders Use preferred media providers order
|
|
150
|
+
* @param {String=} options.receiverLocation Location of WSReceiver.js file
|
|
151
|
+
* @param {String=} options.decoderLocation Location of video-worker2.js file
|
|
152
|
+
* @param {String=} options.screenSharingExtensionId Chrome screen sharing extension id
|
|
153
|
+
* @param {Object=} options.constraints Default local media constraints
|
|
154
|
+
* @param {Object=} options.logger Enable logging
|
|
155
|
+
* @throws {Error} Error if none of MediaProviders available
|
|
156
|
+
* @memberof Flashphoner
|
|
157
|
+
*/
|
|
158
|
+
export function init(options: {
|
|
159
|
+
mediaProvidersReadyCallback?: Function | undefined;
|
|
160
|
+
flashMediaProviderSwfLocation?: string | undefined;
|
|
161
|
+
preferredMediaProvider?: string | undefined;
|
|
162
|
+
preferredMediaProviders?: any[] | undefined;
|
|
163
|
+
receiverLocation?: string | undefined;
|
|
164
|
+
decoderLocation?: string | undefined;
|
|
165
|
+
screenSharingExtensionId?: string | undefined;
|
|
166
|
+
constraints?: any | undefined;
|
|
167
|
+
logger?: any | undefined;
|
|
168
|
+
}): void;
|
|
169
|
+
export function isUsingTemasys(): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Get available MediaProviders.
|
|
172
|
+
*
|
|
173
|
+
* @returns {Array} Available MediaProviders
|
|
174
|
+
* @memberof Flashphoner
|
|
175
|
+
*/
|
|
176
|
+
export function getMediaProviders(): any[];
|
|
177
|
+
/**
|
|
178
|
+
* @typedef Flashphoner.MediaDeviceList
|
|
179
|
+
* @type Object
|
|
180
|
+
* @property {Flashphoner.MediaDevice[]} audio Audio devices (microphones)
|
|
181
|
+
* @property {Flashphoner.MediaDevice[]} video Video devices (cameras)
|
|
182
|
+
*/
|
|
183
|
+
/**
|
|
184
|
+
* @typedef Flashphoner.MediaDevice
|
|
185
|
+
* @type Object
|
|
186
|
+
* @property {String} type Type of device: mic, camera, screen
|
|
187
|
+
* @property {String} id Unique id
|
|
188
|
+
* @property {String} label Device label
|
|
189
|
+
*/
|
|
190
|
+
/**
|
|
191
|
+
* Get available local media devices
|
|
192
|
+
*
|
|
193
|
+
* @param {String=} mediaProvider Media provider that will be asked for device list
|
|
194
|
+
* @param {Boolean=} labels Ask user for microphone access before getting device list.
|
|
195
|
+
* This will make device label available.
|
|
196
|
+
* @param {Flashphoner.constants.MEDIA_DEVICE_KIND} kind Media devices kind to access:
|
|
197
|
+
* MEDIA_DEVICE_KIND.INPUT (default) get access to input devices only (camera, mic).
|
|
198
|
+
* MEDIA_DEVICE_KIND.OUTPUT get access to output devices only (speaker, headphone).
|
|
199
|
+
* MEDIA_DEVICE_KIND.ALL get access to all devices (cam, mic, speaker, headphone).
|
|
200
|
+
* @param {Object=} deviceConstraints If labels == true.
|
|
201
|
+
* If {audio: true, video: false}, then access to the camera will not be requested.
|
|
202
|
+
* If {audio: false, video: true}, then access to the microphone will not be requested.
|
|
203
|
+
* @returns {Promise.<Flashphoner.MediaDeviceList>} Promise with media device list on fulfill
|
|
204
|
+
* @throws {Error} Error if API is not initialized
|
|
205
|
+
* @memberof Flashphoner
|
|
206
|
+
*/
|
|
207
|
+
export function getMediaDevices(mediaProvider: string | undefined, labels: boolean | undefined, kind: any, deviceConstraints?: any | undefined): Promise<Flashphoner.MediaDeviceList>;
|
|
208
|
+
/**
|
|
209
|
+
* Get access to local media
|
|
210
|
+
*
|
|
211
|
+
* @param {Object} constraints Media constraints
|
|
212
|
+
* @param {Object} constraints.audio Audio constraints
|
|
213
|
+
* @param {String=} constraints.audio.deviceId Audio device id
|
|
214
|
+
* @param {Object} constraints.video Video constraints
|
|
215
|
+
* @param {String=} constraints.video.deviceId Video device id
|
|
216
|
+
* @param {number} constraints.video.width Video width
|
|
217
|
+
* @param {number} constraints.video.height Video height
|
|
218
|
+
* @param {number} constraints.video.frameRate Video fps
|
|
219
|
+
* @param {String} constraints.video.type Video device type: camera, screen
|
|
220
|
+
* @param {String} constraints.video.mediaSource Video source type for FF: screen, window
|
|
221
|
+
* @param {HTMLElement} display Div element local media should be displayed in
|
|
222
|
+
* @param {String} mediaProvider Media provider type
|
|
223
|
+
* @param {Boolean} disableConstraintsNormalization Disable constraints normalization
|
|
224
|
+
* @returns {Promise.<HTMLElement>} Promise with display on fulfill
|
|
225
|
+
* @throws {Error} Error if API is not initialized
|
|
226
|
+
* @memberof Flashphoner
|
|
227
|
+
*/
|
|
228
|
+
export function getMediaAccess(constraints: {
|
|
229
|
+
audio: {
|
|
230
|
+
deviceId?: string | undefined;
|
|
231
|
+
};
|
|
232
|
+
video: {
|
|
233
|
+
deviceId?: string | undefined;
|
|
234
|
+
width: number;
|
|
235
|
+
height: number;
|
|
236
|
+
frameRate: number;
|
|
237
|
+
type: string;
|
|
238
|
+
mediaSource: string;
|
|
239
|
+
};
|
|
240
|
+
}, display: HTMLElement, mediaProvider: string, disableConstraintsNormalization: boolean): Promise<HTMLElement>;
|
|
241
|
+
/**
|
|
242
|
+
* Release local media
|
|
243
|
+
*
|
|
244
|
+
* @param {HTMLElement} display Div element with local media
|
|
245
|
+
* @param {String=} mediaProvider Media provider type
|
|
246
|
+
* @returns {Boolean} True if media was found and released
|
|
247
|
+
* @throws {Error} Error if API is not initialized
|
|
248
|
+
* @memberof Flashphoner
|
|
249
|
+
*/
|
|
250
|
+
export function releaseLocalMedia(display: HTMLElement, mediaProvider?: string | undefined): boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Get active sessions.
|
|
253
|
+
*
|
|
254
|
+
* @returns {Session[]} Array containing active sessions
|
|
255
|
+
* @memberof Flashphoner
|
|
256
|
+
*/
|
|
257
|
+
export function getSessions(): Session[];
|
|
258
|
+
/**
|
|
259
|
+
* Get session by id.
|
|
260
|
+
*
|
|
261
|
+
* @param {string} id Session id
|
|
262
|
+
* @returns {Session} Session
|
|
263
|
+
* @memberof Flashphoner
|
|
264
|
+
*/
|
|
265
|
+
export function getSession(id: string): Session;
|
|
266
|
+
/**
|
|
267
|
+
* Create new session and connect to server.
|
|
268
|
+
*
|
|
269
|
+
* @param {Object} options Session options
|
|
270
|
+
* @param {string} options.urlServer Server address in form of [ws,wss]://host.domain:port
|
|
271
|
+
* @param {string} options.authToken Token for auth on server with keepalived client
|
|
272
|
+
* @param {Boolean=} options.keepAlive Keep alive client on server after disconnect
|
|
273
|
+
* @param {string=} options.lbUrl Load-balancer address
|
|
274
|
+
* @param {string=} options.flashProto Flash protocol [rtmp,rtmfp]
|
|
275
|
+
* @param {Integer=} options.flashPort Flash server port [1935]
|
|
276
|
+
* @param {string=} options.appKey REST App key
|
|
277
|
+
* @param {Object=} options.custom User provided custom object that will be available in REST App code
|
|
278
|
+
* @param {Object=} options.sipOptions Sip configuration
|
|
279
|
+
* @param {Object=} options.mediaOptions Media connection configuration
|
|
280
|
+
* @param {Integer=} options.timeout Connection timeout in milliseconds
|
|
281
|
+
* @param {Integer=} options.pingInterval Server ping interval in milliseconds [0]
|
|
282
|
+
* @param {Integer=} options.receiveProbes A maximum subsequental pings received missing count [0]
|
|
283
|
+
* @param {Integer=} options.probesInterval Interval to check subsequental pings received [0]
|
|
284
|
+
* @returns {Session} Created session
|
|
285
|
+
* @throws {Error} Error if API is not initialized
|
|
286
|
+
* @throws {TypeError} Error if options.urlServer is not specified
|
|
287
|
+
* @memberof Flashphoner
|
|
288
|
+
*/
|
|
289
|
+
export function createSession(options: {
|
|
290
|
+
urlServer: string;
|
|
291
|
+
authToken?: string;
|
|
292
|
+
keepAlive?: boolean | undefined;
|
|
293
|
+
lbUrl?: string | undefined;
|
|
294
|
+
flashProto?: string | undefined;
|
|
295
|
+
flashPort?: number | undefined;
|
|
296
|
+
appKey?: string | undefined;
|
|
297
|
+
custom?: any | undefined;
|
|
298
|
+
sipOptions?: any | undefined;
|
|
299
|
+
mediaOptions?: any | undefined;
|
|
300
|
+
timeout?: number | undefined;
|
|
301
|
+
pingInterval?: number | undefined;
|
|
302
|
+
receiveProbes?: number | undefined;
|
|
303
|
+
probesInterval?: number | undefined;
|
|
304
|
+
logger?: any | undefined;
|
|
305
|
+
}): Session;
|
|
306
|
+
/**
|
|
307
|
+
* Play audio chunk
|
|
308
|
+
* @param {boolean} noise Use noise in playing
|
|
309
|
+
* @memberof Flashphoner
|
|
310
|
+
*/
|
|
311
|
+
export function playFirstSound(noise?: boolean): void;
|
|
312
|
+
/**
|
|
313
|
+
* Play video chunk
|
|
314
|
+
*
|
|
315
|
+
* @memberof Flashphoner
|
|
316
|
+
*/
|
|
317
|
+
export function playFirstVideo(display: any, isLocal: any, src: any): any;
|
|
318
|
+
/**
|
|
319
|
+
* Get logger
|
|
320
|
+
*
|
|
321
|
+
* @returns {Object} Logger
|
|
322
|
+
* @memberof Flashphoner
|
|
323
|
+
*/
|
|
324
|
+
export function getLogger(): any;
|
|
325
|
+
import constants = require("@flashphoner/websdk/src/constants");
|
|
326
|
+
declare namespace Flashphoner {
|
|
327
|
+
type MediaDeviceList = {
|
|
328
|
+
/**
|
|
329
|
+
* Video devices (cameras)
|
|
330
|
+
*/
|
|
331
|
+
video: Flashphoner.MediaDevice[];
|
|
332
|
+
};
|
|
333
|
+
type MediaDevice = {
|
|
334
|
+
/**
|
|
335
|
+
* Unique id
|
|
336
|
+
*/
|
|
337
|
+
id: string;
|
|
338
|
+
/**
|
|
339
|
+
* Device label
|
|
340
|
+
*/
|
|
341
|
+
label: string;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
export declare const firefoxScreenSharingExtensionInstalled: boolean;
|
|
345
|
+
export declare const Browser: {
|
|
346
|
+
isIE: () => boolean;
|
|
347
|
+
isFirefox: () => boolean;
|
|
348
|
+
isChrome: () => boolean;
|
|
349
|
+
isEdge: () => boolean;
|
|
350
|
+
isOpera: () => boolean;
|
|
351
|
+
isiOS: () => boolean;
|
|
352
|
+
isSafari: () => boolean;
|
|
353
|
+
isAndroid: () => boolean;
|
|
354
|
+
isSafariWebRTC: () => boolean;
|
|
355
|
+
isSamsungBrowser: () => boolean;
|
|
356
|
+
isAndroidFirefox: () => boolean;
|
|
357
|
+
isChromiumEdge: () => boolean;
|
|
358
|
+
};
|
|
359
|
+
export { constants };
|
package/src/flashphoner-core.js
CHANGED
|
@@ -561,7 +561,7 @@ var createSession = function (options) {
|
|
|
561
561
|
mediaProviders: Object.keys(MediaProvider),
|
|
562
562
|
keepAlive: keepAlive,
|
|
563
563
|
authToken:authToken,
|
|
564
|
-
clientVersion: "2.0
|
|
564
|
+
clientVersion: "2.0",
|
|
565
565
|
clientOSVersion: window.navigator.appVersion,
|
|
566
566
|
clientBrowserVersion: window.navigator.userAgent,
|
|
567
567
|
msePacketizationVersion: 2,
|
|
@@ -1721,6 +1721,14 @@ var createSession = function (options) {
|
|
|
1721
1721
|
var stream = {};
|
|
1722
1722
|
|
|
1723
1723
|
streamEventRefreshHandlers[id_] = function (streamEvent) {
|
|
1724
|
+
if (streamEvent.type == STREAM_EVENT_TYPE.NOT_ENOUGH_BANDWIDTH) {
|
|
1725
|
+
var info = streamEvent.payload.info.split("/");
|
|
1726
|
+
remoteBitrate = info[0];
|
|
1727
|
+
networkBandwidth = info[1];
|
|
1728
|
+
} else if (streamEvent.type == STREAM_EVENT_TYPE.RESIZE) {
|
|
1729
|
+
resolution.width = streamEvent.payload.streamerVideoWidth;
|
|
1730
|
+
resolution.height = streamEvent.payload.streamerVideoHeight;
|
|
1731
|
+
}
|
|
1724
1732
|
if (callbacks[STREAM_EVENT]) {
|
|
1725
1733
|
callbacks[STREAM_EVENT](streamEvent);
|
|
1726
1734
|
}
|
|
@@ -1757,6 +1765,7 @@ var createSession = function (options) {
|
|
|
1757
1765
|
return;
|
|
1758
1766
|
}
|
|
1759
1767
|
|
|
1768
|
+
//Depricated. WCS-3228: RESIZE, SNAPSHOT_COMPLETE and NOT_ENOUGH_BANDWIDTH moved to STREAM_EVENT
|
|
1760
1769
|
if (event == STREAM_STATUS.RESIZE) {
|
|
1761
1770
|
resolution.width = streamInfo.streamerVideoWidth;
|
|
1762
1771
|
resolution.height = streamInfo.streamerVideoHeight;
|