@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
package/docTemplate/README.md
CHANGED
|
@@ -70,6 +70,7 @@ function onLeft() {
|
|
|
70
70
|
function start() {
|
|
71
71
|
var url = $('#url').val();
|
|
72
72
|
var username = $('#login').val();
|
|
73
|
+
var display = document.getElementById("localDisplay");
|
|
73
74
|
if (connection && connection.status() == SESSION_STATUS.ESTABLISHED) {
|
|
74
75
|
//check url and username
|
|
75
76
|
if (connection.getServerUrl() != url || connection.username() != username) {
|
|
@@ -81,7 +82,14 @@ function start() {
|
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
|
|
85
|
+
// Requesting media access before connecting to the server #WCS-3449
|
|
86
|
+
Flashphoner.getMediaAccess(null, localDisplay).then(function() {
|
|
87
|
+
createConnection(url, username);
|
|
88
|
+
}).catch(function(error) {
|
|
89
|
+
console.error("User not allowed media access: "+error);
|
|
90
|
+
$("#failedInfo").text("User not allowed media access. Refresh the page");
|
|
91
|
+
onLeft();
|
|
92
|
+
});
|
|
85
93
|
}
|
|
86
94
|
|
|
87
95
|
function createConnection(url, username) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
var SESSION_STATUS = Flashphoner.constants.SESSION_STATUS;
|
|
2
2
|
var STREAM_STATUS = Flashphoner.constants.STREAM_STATUS;
|
|
3
|
+
var STREAM_EVENT = Flashphoner.constants.STREAM_EVENT;
|
|
4
|
+
var STREAM_EVENT_TYPE = Flashphoner.constants.STREAM_EVENT_TYPE;
|
|
3
5
|
var PRELOADER_URL = "../../dependencies/media/preloader.mp4";
|
|
4
6
|
var Browser = Flashphoner.Browser;
|
|
5
7
|
var remoteVideo;
|
|
@@ -182,8 +184,16 @@ function playStream(session) {
|
|
|
182
184
|
$("#preloader").hide();
|
|
183
185
|
setStatus(STREAM_STATUS.FAILED, stream);
|
|
184
186
|
onStopped();
|
|
185
|
-
}).on(
|
|
186
|
-
|
|
187
|
+
}).on(STREAM_EVENT, function(streamEvent){
|
|
188
|
+
if (STREAM_EVENT_TYPE.NOT_ENOUGH_BANDWIDTH === streamEvent.type) {
|
|
189
|
+
var info = streamEvent.payload.info.split("/");
|
|
190
|
+
var remoteBitrate = info[0];
|
|
191
|
+
var networkBandwidth = info[1];
|
|
192
|
+
console.log("Not enough bandwidth, consider using lower video resolution or bitrate. Bandwidth " + (Math.round(networkBandwidth / 1000)) + " bitrate " + (Math.round(remoteBitrate / 1000)));
|
|
193
|
+
} else if (STREAM_EVENT_TYPE.RESIZE === streamEvent.type) {
|
|
194
|
+
console.log("New video size: " + streamEvent.payload.streamerVideoWidth + "x" + streamEvent.payload.streamerVideoHeight);
|
|
195
|
+
}
|
|
196
|
+
|
|
187
197
|
});
|
|
188
198
|
stream.play();
|
|
189
199
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
var SESSION_STATUS = Flashphoner.constants.SESSION_STATUS;
|
|
2
2
|
var STREAM_STATUS = Flashphoner.constants.STREAM_STATUS;
|
|
3
|
+
var STREAM_EVENT = Flashphoner.constants.STREAM_EVENT;
|
|
4
|
+
var STREAM_EVENT_TYPE = Flashphoner.constants.STREAM_EVENT_TYPE;
|
|
3
5
|
var PRELOADER_URL = "../../dependencies/media/preloader.mp4";
|
|
4
6
|
var Browser = Flashphoner.Browser;
|
|
5
7
|
var localVideo;
|
|
@@ -30,17 +32,15 @@ function init_page() {
|
|
|
30
32
|
function snapshot(name) {
|
|
31
33
|
setSnapshotStatus();
|
|
32
34
|
var session = Flashphoner.getSessions()[0];
|
|
33
|
-
session.createStream({name: name}).on(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
setSnapshotStatus(STREAM_STATUS.FAILED);
|
|
43
|
-
console.log("Snapshot failed, info: " + stream.getInfo());
|
|
35
|
+
session.createStream({name: name}).on(STREAM_EVENT, function(streamEvent){
|
|
36
|
+
if (STREAM_EVENT_TYPE.SNAPSHOT_COMPLETED === streamEvent.type) {
|
|
37
|
+
console.log("Snapshot complete");
|
|
38
|
+
setSnapshotStatus(STREAM_STATUS.SNAPSHOT_COMPLETE);
|
|
39
|
+
snapshotImg.src = "data:image/png;base64,"+streamEvent.payload.snapshot;
|
|
40
|
+
} else if (STREAM_EVENT_TYPE.SNAPSHOT_FAILED === streamEvent.type) {
|
|
41
|
+
setSnapshotStatus(STREAM_STATUS.FAILED);
|
|
42
|
+
console.log("Snapshot failed, info: " + streamEvent.payload.info);
|
|
43
|
+
}
|
|
44
44
|
}).snapshot();
|
|
45
45
|
}
|
|
46
46
|
|
package/examples/demo/streaming/video-chat-and-screen-sharing/video-chat-and-screen-sharing.js
CHANGED
|
@@ -140,6 +140,7 @@ function onLeft() {
|
|
|
140
140
|
function start() {
|
|
141
141
|
var url = $('#url').val();
|
|
142
142
|
var username = $('#login').val();
|
|
143
|
+
var display = document.getElementById("localDisplay");
|
|
143
144
|
if (connection && connection.status() == SESSION_STATUS.ESTABLISHED) {
|
|
144
145
|
//check url and username
|
|
145
146
|
if (connection.getServerUrl() != url || connection.username() != username) {
|
|
@@ -151,6 +152,17 @@ function start() {
|
|
|
151
152
|
return;
|
|
152
153
|
}
|
|
153
154
|
}
|
|
155
|
+
// Requesting media access before connecting to the server #WCS-3449
|
|
156
|
+
Flashphoner.getMediaAccess(null, localDisplay).then(function() {
|
|
157
|
+
createConnection(url, username);
|
|
158
|
+
}).catch(function(error) {
|
|
159
|
+
console.error("User not allowed media access: "+error);
|
|
160
|
+
$("#failedInfo").text("User not allowed media access. Refresh the page");
|
|
161
|
+
onLeft();
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function createConnection(url, username) {
|
|
154
166
|
connection = RoomApi.connect({urlServer: url, username: username}).on(SESSION_STATUS.FAILED, function(session){
|
|
155
167
|
setStatus('#status', session.status());
|
|
156
168
|
onLeft();
|