@flashphoner/websdk 2.0.226 → 2.0.228
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/embed_player/sample.js +4 -4
- package/examples/demo/streaming/embed_player/utils.js +49 -3
- package/flashphoner-no-flash.js +2 -2
- package/flashphoner-no-webrtc.js +2 -2
- package/flashphoner-no-wsplayer.js +2 -2
- package/flashphoner-room-api.js +15 -12
- package/flashphoner-temasys-flash-websocket-without-adapterjs.js +2 -2
- package/flashphoner-temasys-flash-websocket.js +2 -2
- package/package.json +1 -1
- package/src/flashphoner-core.d.ts +28 -25
- package/src/room-module.d.ts +31 -2
- package/src/room-module.js +15 -12
package/package.json
CHANGED
|
@@ -80,35 +80,38 @@ export declare class Stream {
|
|
|
80
80
|
getLogger: () => any;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
export declare class CreateStreamOptions {
|
|
84
|
+
name: string;
|
|
85
|
+
constraints?: any | undefined;
|
|
86
|
+
mediaProvider: string;
|
|
87
|
+
receiveAudio?: boolean | undefined;
|
|
88
|
+
receiveVideo?: boolean | undefined;
|
|
89
|
+
cacheLocalResources?: boolean | undefined;
|
|
90
|
+
playWidth?: number | undefined;
|
|
91
|
+
playHeight?: number | undefined;
|
|
92
|
+
record?: boolean | undefined;
|
|
93
|
+
display: any;
|
|
94
|
+
custom?: any | undefined;
|
|
95
|
+
stripCodecs?: string | undefined;
|
|
96
|
+
rtmpUrl?: string | undefined;
|
|
97
|
+
mediaConnectionConstraints?: any | undefined;
|
|
98
|
+
flashShowFullScreenButton?: boolean | undefined;
|
|
99
|
+
transport?: string | undefined;
|
|
100
|
+
cvoExtension?: boolean | undefined;
|
|
101
|
+
playoutDelay?: number | undefined;
|
|
102
|
+
useCanvasMediaStream?: boolean | undefined;
|
|
103
|
+
videoContentHint?: string | undefined;
|
|
104
|
+
unmutePlayOnStart?: boolean | undefined;
|
|
105
|
+
sdpHook?: any | undefined
|
|
106
|
+
logger?: any | undefined;
|
|
107
|
+
disableConstraintsNormalization?: boolean | undefined;
|
|
108
|
+
}
|
|
109
|
+
|
|
83
110
|
export declare class Session {
|
|
84
111
|
id: () => string;
|
|
85
112
|
status: () => string;
|
|
86
113
|
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;
|
|
114
|
+
createStream: (options: CreateStreamOptions) => Stream;
|
|
112
115
|
createCall: (options: {
|
|
113
116
|
callee: string;
|
|
114
117
|
visibleName?: string | undefined;
|
package/src/room-module.d.ts
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* @param {Object} options session options
|
|
10
10
|
* @param {String} options.urlServer Server address in form of [ws,wss]://host.domain:port
|
|
11
11
|
* @param {String} options.username Username to login with
|
|
12
|
-
* @
|
|
12
|
+
* @param {String} options.token JWT token
|
|
13
|
+
* @param {String} options.appKey Application key
|
|
14
|
+
* @returns {roomApi.RoomSession}
|
|
13
15
|
* @memberof roomApi
|
|
14
16
|
* @method connect
|
|
15
17
|
*/
|
|
@@ -17,7 +19,34 @@ import Flashphoner = require("./flashphoner-core");
|
|
|
17
19
|
declare function appSession(options: {
|
|
18
20
|
urlServer: string;
|
|
19
21
|
username: string;
|
|
20
|
-
|
|
22
|
+
token?: string;
|
|
23
|
+
appKey?: string;
|
|
24
|
+
}): RoomSession;
|
|
25
|
+
export declare class RoomSession extends Flashphoner.Session {
|
|
26
|
+
getRooms: () => Room[];
|
|
27
|
+
join: ({name, record}: {name: string, record: boolean}) => Room;
|
|
28
|
+
username: () => string;
|
|
29
|
+
}
|
|
30
|
+
export declare class Room {
|
|
31
|
+
name: () => string;
|
|
32
|
+
leave: () => Promise<any>;
|
|
33
|
+
publish: (options: Flashphoner.CreateStreamOptions) => any;
|
|
34
|
+
getParticipants: () => Participant[];
|
|
35
|
+
on: (event: string, callback: any) => Room;
|
|
36
|
+
}
|
|
37
|
+
export declare class Participant {
|
|
38
|
+
getStreams: () => ParticipantStream[];
|
|
39
|
+
name: () => string;
|
|
40
|
+
sendMessage: (text: any, error: any) => void; //msg in chat (text - msg to send; error- err callback)
|
|
41
|
+
streams: ParticipantStreams;
|
|
42
|
+
}
|
|
43
|
+
export type ParticipantStreams = { [key: string]: ParticipantStream };
|
|
44
|
+
export declare class ParticipantStream {
|
|
45
|
+
play: (display: any, options?: {}) => Flashphoner.Stream;
|
|
46
|
+
stop: () => void;
|
|
47
|
+
id: () => string;
|
|
48
|
+
streamName: () => string
|
|
49
|
+
}
|
|
21
50
|
export namespace events {
|
|
22
51
|
const STATE: string;
|
|
23
52
|
const JOINED: string;
|
package/src/room-module.js
CHANGED
|
@@ -19,7 +19,9 @@ var Flashphoner = require('./flashphoner-core');
|
|
|
19
19
|
* @param {Object} options session options
|
|
20
20
|
* @param {String} options.urlServer Server address in form of [ws,wss]://host.domain:port
|
|
21
21
|
* @param {String} options.username Username to login with
|
|
22
|
-
* @
|
|
22
|
+
* @param {String} options.token JWT Token
|
|
23
|
+
* @param {String} options.appKey Application Key
|
|
24
|
+
* @returns {roomApi.RoomSession}
|
|
23
25
|
* @memberof roomApi
|
|
24
26
|
* @method connect
|
|
25
27
|
*/
|
|
@@ -27,7 +29,7 @@ var appSession = function (options) {
|
|
|
27
29
|
/**
|
|
28
30
|
* Represents connection to room api app
|
|
29
31
|
*
|
|
30
|
-
* @namespace roomApi.
|
|
32
|
+
* @namespace roomApi.RoomSession
|
|
31
33
|
*/
|
|
32
34
|
var callbacks = {};
|
|
33
35
|
var rooms = {};
|
|
@@ -70,7 +72,7 @@ var appSession = function (options) {
|
|
|
70
72
|
/**
|
|
71
73
|
* Disconnect session
|
|
72
74
|
*
|
|
73
|
-
* @memberof roomApi.
|
|
75
|
+
* @memberof roomApi.RoomSession
|
|
74
76
|
* @inner
|
|
75
77
|
*/
|
|
76
78
|
var disconnect = function () {
|
|
@@ -81,7 +83,7 @@ var appSession = function (options) {
|
|
|
81
83
|
* Get session status
|
|
82
84
|
*
|
|
83
85
|
* @returns {string} One of {@link Flashphoner.constants.SESSION_STATUS}
|
|
84
|
-
* @memberof roomApi.
|
|
86
|
+
* @memberof roomApi.RoomSession
|
|
85
87
|
* @inner
|
|
86
88
|
*/
|
|
87
89
|
var status = function () {
|
|
@@ -92,7 +94,7 @@ var appSession = function (options) {
|
|
|
92
94
|
* Get session id
|
|
93
95
|
*
|
|
94
96
|
* @returns {string} session id
|
|
95
|
-
* @memberof roomApi.
|
|
97
|
+
* @memberof roomApi.RoomSession
|
|
96
98
|
* @inner
|
|
97
99
|
*/
|
|
98
100
|
var id = function () {
|
|
@@ -103,7 +105,7 @@ var appSession = function (options) {
|
|
|
103
105
|
* Get server address
|
|
104
106
|
*
|
|
105
107
|
* @returns {string} Server url
|
|
106
|
-
* @memberof roomApi.
|
|
108
|
+
* @memberof roomApi.RoomSession
|
|
107
109
|
* @inner
|
|
108
110
|
*/
|
|
109
111
|
var getServerUrl = function () {
|
|
@@ -114,7 +116,7 @@ var appSession = function (options) {
|
|
|
114
116
|
* Get session username
|
|
115
117
|
*
|
|
116
118
|
* @returns {string} username
|
|
117
|
-
* @memberof roomApi.
|
|
119
|
+
* @memberof roomApi.RoomSession
|
|
118
120
|
* @inner
|
|
119
121
|
*/
|
|
120
122
|
var username = function () {
|
|
@@ -125,7 +127,7 @@ var appSession = function (options) {
|
|
|
125
127
|
* Get rooms
|
|
126
128
|
*
|
|
127
129
|
* @returns {roomApi.Room[]}
|
|
128
|
-
* @memberof roomApi.
|
|
130
|
+
* @memberof roomApi.RoomSession
|
|
129
131
|
* @inner
|
|
130
132
|
*/
|
|
131
133
|
var getRooms = function () {
|
|
@@ -137,11 +139,11 @@ var appSession = function (options) {
|
|
|
137
139
|
* Add session event callback.
|
|
138
140
|
*
|
|
139
141
|
* @param {string} event One of {@link Flashphoner.constants.SESSION_STATUS} events
|
|
140
|
-
* @param {
|
|
141
|
-
* @returns {roomApi.
|
|
142
|
+
* @param {RoomSession~eventCallback} callback Callback function
|
|
143
|
+
* @returns {roomApi.RoomSession} Room Session
|
|
142
144
|
* @throws {TypeError} Error if event is not specified
|
|
143
145
|
* @throws {Error} Error if callback is not a valid function
|
|
144
|
-
* @memberof roomApi.
|
|
146
|
+
* @memberof roomApi.RoomSession
|
|
145
147
|
* @inner
|
|
146
148
|
*/
|
|
147
149
|
var on = function (event, callback) {
|
|
@@ -160,8 +162,9 @@ var appSession = function (options) {
|
|
|
160
162
|
*
|
|
161
163
|
* @param {Object} options Room options
|
|
162
164
|
* @param {String} options.name Room name
|
|
165
|
+
* @param {Boolean} options.record Record
|
|
163
166
|
* @returns {roomApi.Room}
|
|
164
|
-
* @memberof roomApi.
|
|
167
|
+
* @memberof roomApi.RoomSession
|
|
165
168
|
* @inner
|
|
166
169
|
*/
|
|
167
170
|
var join = function (options) {
|