@flashphoner/websdk 2.0.202 → 2.0.207
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/sip/phone/phone.js +7 -10
- package/examples/demo/streaming/hls-player/hls-player.html +1 -4
- package/examples/demo/streaming/hls-player/hls-player.js +19 -1
- package/examples/demo/streaming/hls-player/player-page.html +1 -1
- package/examples/demo/streaming/hls-player/video-js.css +142 -51
- package/examples/demo/streaming/hls-player/video.js +27294 -20390
- package/examples/demo/streaming/hls-player/video.min.js +27 -0
- package/examples/demo/streaming/media_devices_manager/manager.js +27 -1
- package/examples/demo/streaming/media_devices_manager/media_device_manager.html +7 -0
- package/examples/demo/streaming/stream-auto-restore/stream-auto-restore.css +23 -0
- package/examples/demo/streaming/stream-auto-restore/stream-auto-restore.html +76 -0
- package/examples/demo/streaming/stream-auto-restore/stream-auto-restore.js +356 -0
- package/examples/typescript/two-way-streaming-ts/.gitignore +23 -0
- package/examples/typescript/two-way-streaming-ts/README.md +36 -0
- package/examples/typescript/two-way-streaming-ts/package.json +45 -0
- package/examples/typescript/two-way-streaming-ts/public/favicon.ico +0 -0
- package/examples/typescript/two-way-streaming-ts/public/index.html +33 -0
- package/examples/typescript/two-way-streaming-ts/public/logo192.png +0 -0
- package/examples/typescript/two-way-streaming-ts/public/logo512.png +0 -0
- package/examples/typescript/two-way-streaming-ts/public/manifest.json +25 -0
- package/examples/typescript/two-way-streaming-ts/public/media/preloader.mp4 +0 -0
- package/examples/typescript/two-way-streaming-ts/public/robots.txt +3 -0
- package/examples/typescript/two-way-streaming-ts/src/TwoWayStreamingApp.css +23 -0
- package/examples/typescript/two-way-streaming-ts/src/TwoWayStreamingApp.tsx +371 -0
- package/examples/typescript/two-way-streaming-ts/src/fp-utils.ts +117 -0
- package/examples/typescript/two-way-streaming-ts/src/index.css +13 -0
- package/examples/typescript/two-way-streaming-ts/src/index.tsx +9 -0
- package/examples/typescript/two-way-streaming-ts/tsconfig.json +26 -0
- package/flashphoner-no-flash.js +19 -19
- package/flashphoner-no-flash.min.js +2 -2
- package/flashphoner-no-webrtc.js +18 -18
- package/flashphoner-no-webrtc.min.js +1 -1
- package/flashphoner-no-wsplayer.js +20 -20
- package/flashphoner-no-wsplayer.min.js +2 -2
- package/flashphoner-room-api.js +6 -6
- package/flashphoner-room-api.min.js +2 -2
- package/flashphoner-temasys-flash-websocket-without-adapterjs.js +20 -20
- package/flashphoner-temasys-flash-websocket.js +20 -20
- package/flashphoner-temasys-flash-websocket.min.js +1 -1
- package/flashphoner-webrtc-only.js +17 -17
- package/flashphoner-webrtc-only.min.js +1 -1
- package/flashphoner.js +20 -20
- package/flashphoner.min.js +2 -2
- package/package.json +2 -1
- package/src/constants.d.ts +1 -0
- package/src/flashphoner-core.d.ts +192 -0
- package/src/flashphoner-core.js +4 -4
- package/src/room-module.d.ts +29 -0
- package/src/webrtc-media-provider.js +2 -2
- package/examples/demo/streaming/hls-player/videojs-hls.min.js +0 -27
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flashphoner/websdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.207",
|
|
4
4
|
"description": "Official Flashphoner WebCallServer WebSDK package",
|
|
5
5
|
"main": "./src/flashphoner-core.js",
|
|
6
|
+
"types": "./src/flashphoner-core.d.ts",
|
|
6
7
|
"dependencies": {
|
|
7
8
|
"adapterjs": "0.15.5",
|
|
8
9
|
"es6-promise": "4.0.5",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default constants as any;
|
|
@@ -0,0 +1,192 @@
|
|
|
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?: Array<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
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare class Stream {
|
|
41
|
+
play: () => void;
|
|
42
|
+
publish: () => void;
|
|
43
|
+
stop: () => void;
|
|
44
|
+
id: () => string;
|
|
45
|
+
status: () => string;
|
|
46
|
+
name: () => string;
|
|
47
|
+
published: () => boolean;
|
|
48
|
+
getRecordInfo: () => string;
|
|
49
|
+
getInfo: () => string;
|
|
50
|
+
getErrorInfo: () => string;
|
|
51
|
+
videoResolution: () => any;
|
|
52
|
+
setAudioOutputId: (id: string) => any;
|
|
53
|
+
setVolume: (volume: number) => void;
|
|
54
|
+
unmuteRemoteAudio: () => void;
|
|
55
|
+
muteRemoteAudio: () => void;
|
|
56
|
+
isRemoteAudioMuted: () => boolean;
|
|
57
|
+
setMicrophoneGain: (volume: number) => void;
|
|
58
|
+
getVolume: () => number;
|
|
59
|
+
muteAudio: () => void;
|
|
60
|
+
unmuteAudio: () => void;
|
|
61
|
+
isAudioMuted: () => boolean;
|
|
62
|
+
muteVideo: () => void;
|
|
63
|
+
unmuteVideo: () => void;
|
|
64
|
+
isVideoMuted: () => boolean;
|
|
65
|
+
getStats: (callbackFn: any, nativeStats: boolean) => any;
|
|
66
|
+
snapshot: () => void;
|
|
67
|
+
getAudioState: () => any;
|
|
68
|
+
getVideoState: () => any;
|
|
69
|
+
getNetworkBandwidth: () => number;
|
|
70
|
+
getRemoteBitrate: () => number;
|
|
71
|
+
fullScreen: () => void;
|
|
72
|
+
on: (event: string, callback: any) => Stream;
|
|
73
|
+
available: () => any;
|
|
74
|
+
switchCam: (deviceId: any) => any;
|
|
75
|
+
switchMic: (deviceId: any) => any;
|
|
76
|
+
switchToScreen: (source: string, woExtension: boolean) => any;
|
|
77
|
+
switchToCam: () => void;
|
|
78
|
+
sendData: (payload: any) => void;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export declare class Session {
|
|
82
|
+
id: () => string;
|
|
83
|
+
status: () => string;
|
|
84
|
+
getServerUrl: () => string;
|
|
85
|
+
createStream: (options: {
|
|
86
|
+
name: string;
|
|
87
|
+
constraints?: any | undefined;
|
|
88
|
+
mediaProvider: string;
|
|
89
|
+
receiveAudio?: boolean | undefined;
|
|
90
|
+
receiveVideo?: boolean | undefined;
|
|
91
|
+
cacheLocalResources?: boolean | undefined;
|
|
92
|
+
playWidth?: number | undefined;
|
|
93
|
+
playHeight?: number | undefined;
|
|
94
|
+
|
|
95
|
+
}) => Stream;
|
|
96
|
+
createCall: (options: {
|
|
97
|
+
callee: string;
|
|
98
|
+
visibleName?: string | undefined;
|
|
99
|
+
constraints: any;
|
|
100
|
+
mediaProvider: string;
|
|
101
|
+
receiveAudio?: boolean | undefined;
|
|
102
|
+
receiveVideo?: boolean | undefined;
|
|
103
|
+
cacheLocalResources?: boolean | undefined;
|
|
104
|
+
localVideoDisplay: HTMLElement;
|
|
105
|
+
remoteVideoDisplay: HTMLElement;
|
|
106
|
+
custom?: any | undefined;
|
|
107
|
+
stripCodecs?: Array<string> | undefined;
|
|
108
|
+
sipSDP?: Array<string> | undefined;
|
|
109
|
+
sipHeaders?: Array<string> | undefined;
|
|
110
|
+
videoContentHint?: string | undefined;
|
|
111
|
+
}) => Call;
|
|
112
|
+
getStream: (streamId: string) => any;
|
|
113
|
+
getStreams: () => any[];
|
|
114
|
+
sendData: (data: any) => any;
|
|
115
|
+
disconnect: () => void;
|
|
116
|
+
submitBugReport: (reportObject: any) => void;
|
|
117
|
+
startDebug: () => void;
|
|
118
|
+
stopDebug: () => void;
|
|
119
|
+
on: (event: string, callback: any) => Session;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export namespace Browser {
|
|
123
|
+
export function isIE(): boolean;
|
|
124
|
+
export function isFirefox(): boolean;
|
|
125
|
+
export function isChrome(): boolean;
|
|
126
|
+
export function isEdge(): boolean;
|
|
127
|
+
export function isOpera(): boolean;
|
|
128
|
+
export function isiOS(): boolean;
|
|
129
|
+
export function isSafari(): boolean;
|
|
130
|
+
export function isAndroid(): boolean;
|
|
131
|
+
export function isSafariWebRTC(): boolean;
|
|
132
|
+
export function isSamsungBrowser(): boolean;
|
|
133
|
+
export function isAndroidFirefox(): boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function init(options: {
|
|
137
|
+
mediaProvidersReadyCallback?: Function | undefined;
|
|
138
|
+
flashMediaProviderSwfLocation?: string | undefined;
|
|
139
|
+
preferredMediaProvider?: string | undefined;
|
|
140
|
+
preferredMediaProviders?: any[] | undefined;
|
|
141
|
+
receiverLocation?: string | undefined;
|
|
142
|
+
decoderLocation?: string | undefined;
|
|
143
|
+
screenSharingExtensionId?: string | undefined;
|
|
144
|
+
constraints?: any | undefined;
|
|
145
|
+
logger?: any | undefined;
|
|
146
|
+
}): void;
|
|
147
|
+
export function isUsingTemasys(): boolean;
|
|
148
|
+
export function getMediaProviders(): any[];
|
|
149
|
+
export function getMediaDevices(
|
|
150
|
+
mediaProvider: string | undefined,
|
|
151
|
+
labels: boolean | undefined,
|
|
152
|
+
kind: any,
|
|
153
|
+
deviceConstraints: any | undefined): any;
|
|
154
|
+
export function getMediaAccess(
|
|
155
|
+
constraints: {
|
|
156
|
+
audio: {
|
|
157
|
+
deviceId?: string | undefined;
|
|
158
|
+
};
|
|
159
|
+
video: {
|
|
160
|
+
deviceId?: string | undefined;
|
|
161
|
+
width: number;
|
|
162
|
+
height: number;
|
|
163
|
+
frameRate: number;
|
|
164
|
+
type: string;
|
|
165
|
+
mediaSource: string;
|
|
166
|
+
};
|
|
167
|
+
}, display: HTMLElement, mediaProvider: string, disableConstraintsNormalization: boolean): any;
|
|
168
|
+
export function releaseLocalMedia(display: HTMLElement, mediaProvider?: string | undefined): boolean;
|
|
169
|
+
export function getSessions(): any[];
|
|
170
|
+
export function getSession(id: string): any;
|
|
171
|
+
export function createSession(options: {
|
|
172
|
+
urlServer: string;
|
|
173
|
+
authToken?: string;
|
|
174
|
+
keepAlive?: boolean | undefined;
|
|
175
|
+
lbUrl?: string | undefined;
|
|
176
|
+
flashProto?: string | undefined;
|
|
177
|
+
flashPort?: any | undefined;
|
|
178
|
+
appKey?: string | undefined;
|
|
179
|
+
custom?: any | undefined;
|
|
180
|
+
sipOptions?: any | undefined;
|
|
181
|
+
mediaOptions?: any | undefined;
|
|
182
|
+
timeout?: any | undefined;
|
|
183
|
+
}): Session;
|
|
184
|
+
export function playFirstSound (noise?: boolean): any;
|
|
185
|
+
export function playFirstVideo (display: any, isLocal: boolean, src: any): any;
|
|
186
|
+
export function getLogger(): any;
|
|
187
|
+
import { constants } from "@flashphoner/websdk/src/constants";
|
|
188
|
+
export declare const firefoxScreenSharingExtensionInstalled: boolean;
|
|
189
|
+
export { constants };
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
package/src/flashphoner-core.js
CHANGED
|
@@ -534,7 +534,7 @@ var createSession = function (options) {
|
|
|
534
534
|
mediaProviders: Object.keys(MediaProvider),
|
|
535
535
|
keepAlive: keepAlive,
|
|
536
536
|
authToken:authToken,
|
|
537
|
-
clientVersion: "2.0.
|
|
537
|
+
clientVersion: "2.0.207",
|
|
538
538
|
clientOSVersion: window.navigator.appVersion,
|
|
539
539
|
clientBrowserVersion: window.navigator.userAgent,
|
|
540
540
|
msePacketizationVersion: 2,
|
|
@@ -719,7 +719,7 @@ var createSession = function (options) {
|
|
|
719
719
|
* @param {HTMLElement} options.localVideoDisplay Div element local video should be displayed in
|
|
720
720
|
* @param {HTMLElement} options.remoteVideoDisplay Div element remote video should be displayed in
|
|
721
721
|
* @param {Object=} options.custom User provided custom object that will be available in REST App code
|
|
722
|
-
* @param {
|
|
722
|
+
* @param {string=} options.stripCodecs Comma separated strings of codecs which should be stripped from WebRTC SDP (ex. "SILK,G722")
|
|
723
723
|
* @param {Array<string>=} options.sipSDP Array of custom SDP params (ex. bandwidth (b=))
|
|
724
724
|
* @param {Array<string>=} options.sipHeaders Array of custom SIP headers
|
|
725
725
|
* @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
|
|
@@ -959,7 +959,7 @@ var createSession = function (options) {
|
|
|
959
959
|
* @param {Boolean=} answerOptions.receiveAudio Receive audio
|
|
960
960
|
* @param {Boolean=} answerOptions.receiveVideo Receive video
|
|
961
961
|
* @param {String=} answerOptions.constraints Answer call with constraints
|
|
962
|
-
* @param {
|
|
962
|
+
* @param {String=} answerOptions.stripCodecs Comma separated string of codecs which should be stripped from WebRTC SDP (ex. "SILK,G722")
|
|
963
963
|
* @param {Array<string>=} answerOptions.sipSDP Array of custom SDP params (ex. bandwidth (b=))
|
|
964
964
|
* @param {Array<string>=} answerOptions.sipHeaders Array of custom SIP headers
|
|
965
965
|
* @param {sdpHook} sdpHook The callback that handles sdp from the server
|
|
@@ -1472,7 +1472,7 @@ var createSession = function (options) {
|
|
|
1472
1472
|
* @param {HTMLElement} options.display Div element stream should be displayed in
|
|
1473
1473
|
* @param {Object=} options.custom User provided custom object that will be available in REST App code
|
|
1474
1474
|
* @param {Integer} [options.flashBufferTime=0] Specifies how long to buffer messages before starting to display the stream (Flash-only)
|
|
1475
|
-
* @param {
|
|
1475
|
+
* @param {String=} options.stripCodecs Comma separated string of codecs which should be stripped from WebRTC SDP (ex. "H264,PCMA,PCMU,G722")
|
|
1476
1476
|
* @param {string=} options.rtmpUrl Rtmp url stream should be forwarded to
|
|
1477
1477
|
* @param {Object=} options.mediaConnectionConstraints Stream specific constraints for underlying RTCPeerConnection
|
|
1478
1478
|
* @param {Boolean=} options.flashShowFullScreenButton Show full screen button in flash
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Room api based on core api
|
|
3
|
+
*
|
|
4
|
+
* @namespace roomApi
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Initialize connection
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} options session options
|
|
10
|
+
* @param {String} options.urlServer Server address in form of [ws,wss]://host.domain:port
|
|
11
|
+
* @param {String} options.username Username to login with
|
|
12
|
+
* @returns {roomApi.Session}
|
|
13
|
+
* @memberof roomApi
|
|
14
|
+
* @method connect
|
|
15
|
+
*/
|
|
16
|
+
declare function appSession(options: {
|
|
17
|
+
urlServer: string;
|
|
18
|
+
username: string;
|
|
19
|
+
}): any;
|
|
20
|
+
export namespace events {
|
|
21
|
+
const STATE: string;
|
|
22
|
+
const JOINED: string;
|
|
23
|
+
const LEFT: string;
|
|
24
|
+
const PUBLISHED: string;
|
|
25
|
+
const MESSAGE: string;
|
|
26
|
+
const FAILED: string;
|
|
27
|
+
}
|
|
28
|
+
import Flashphoner = require("@flashphoner/websdk/src/flashphoner-core");
|
|
29
|
+
export { appSession as connect, Flashphoner as sdk };
|
|
@@ -417,14 +417,14 @@ var createConnection = function (options) {
|
|
|
417
417
|
if (!report.isRemote) {
|
|
418
418
|
if (report.type == 'outbound-rtp') {
|
|
419
419
|
fillStatObject(result.outboundStream, report);
|
|
420
|
-
if (report.mediaType == 'video') {
|
|
420
|
+
if (report.mediaType == 'video' && localVideo != undefined && localVideo != null) {
|
|
421
421
|
var vSettings = localVideo.srcObject.getVideoTracks()[0].getSettings();
|
|
422
422
|
result.outboundStream[report.mediaType].height = vSettings.height;
|
|
423
423
|
result.outboundStream[report.mediaType].width = vSettings.width;
|
|
424
424
|
}
|
|
425
425
|
} else if (report.type == 'inbound-rtp') {
|
|
426
426
|
fillStatObject(result.inboundStream, report);
|
|
427
|
-
if (report.mediaType == 'video' && remoteVideo != undefined) {
|
|
427
|
+
if (report.mediaType == 'video' && remoteVideo != undefined && remoteVideo != null) {
|
|
428
428
|
result.inboundStream[report.mediaType].height = remoteVideo.videoHeight;
|
|
429
429
|
result.inboundStream[report.mediaType].width = remoteVideo.videoWidth;
|
|
430
430
|
}
|