@flashphoner/websdk 2.0.218 → 2.0.222

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashphoner/websdk",
3
- "version": "2.0.218",
3
+ "version": "2.0.222",
4
4
  "description": "Official Flashphoner WebCallServer WebSDK package",
5
5
  "main": "./src/flashphoner-core.js",
6
6
  "types": "./src/flashphoner-core.d.ts",
package/src/constants.js CHANGED
@@ -147,12 +147,14 @@ const STREAM_STATUS = Object.freeze({
147
147
  */
148
148
  PLAYBACK_PROBLEM: 'PLAYBACK_PROBLEM',
149
149
  /**
150
+ * @deprecated WCS-3228 moved to {@link STREAM_EVENT_TYPE}
150
151
  * Fires if playing {@link Stream} picture resizing.
151
152
  * @event RESIZE
152
153
  * @memberof Flashphoner.constants.STREAM_STATUS
153
154
  */
154
155
  RESIZE: 'RESIZE',
155
156
  /**
157
+ * @deprecated WCS-3228 moved to {@link STREAM_EVENT_TYPE}
156
158
  * Fires when {@link Stream} snapshot becomes available.
157
159
  * Snapshot is base64 encoded png available through {@link Stream.getInfo}
158
160
  * @event SNAPSHOT_COMPLETE
@@ -160,6 +162,7 @@ const STREAM_STATUS = Object.freeze({
160
162
  */
161
163
  SNAPSHOT_COMPLETE: 'SNAPSHOT_COMPLETE',
162
164
  /**
165
+ * @deprecated WCS-3228 moved to {@link STREAM_EVENT_TYPE}
163
166
  * Fires on playing {@link Stream} if bitrate is higher than available network bandwidth.
164
167
  * @event NOT_ENOUGH_BANDWIDTH
165
168
  * @memberof Flashphoner.constants.NOT_ENOUGH_BANDWIDTH
@@ -775,7 +778,31 @@ const STREAM_EVENT_TYPE = Object.freeze({
775
778
  * @see Stream
776
779
  * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
777
780
  */
778
- DATA: 'data'
781
+ DATA: 'data',
782
+ /**
783
+ * Stream snapshot is completed
784
+ * @see Stream
785
+ * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
786
+ */
787
+ SNAPSHOT_COMPLETED: 'snapshotCompleted',
788
+ /**
789
+ * Stream snapshot is failed
790
+ * @see Stream
791
+ * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
792
+ */
793
+ SNAPSHOT_FAILED: 'snapshotFailed',
794
+ /**
795
+ * Fires if playing {@link Stream} picture resizing.
796
+ * @event RESIZE
797
+ * @memberof Flashphoner.constants.STREAM_STATUS
798
+ */
799
+ RESIZE: 'resize',
800
+ /**
801
+ * Fires on playing {@link Stream} if bitrate is higher than available network bandwidth.
802
+ * @event NOT_ENOUGH_BANDWIDTH
803
+ * @memberof Flashphoner.constants.NOT_ENOUGH_BANDWIDTH
804
+ */
805
+ NOT_ENOUGH_BANDWIDTH: 'notEnoughBandwidth'
779
806
  });
780
807
 
781
808
  /**
@@ -108,7 +108,8 @@ var init = function (options) {
108
108
  }
109
109
  }
110
110
 
111
- var flashProvider = require("./flash-media-provider");
111
+ // flashMediaProvider is disables by default due to end of support in the most browsers #WCS-3577
112
+ var flashProvider = null;
112
113
  if (flashProvider && flashProvider.hasOwnProperty('available') && flashProvider.available() &&
113
114
  (!MediaProvider.WebRTC || (options.preferredMediaProviders && options.preferredMediaProviders.indexOf("Flash") >= 0))) {
114
115
  MediaProvider.Flash = flashProvider;
@@ -561,7 +562,7 @@ var createSession = function (options) {
561
562
  mediaProviders: Object.keys(MediaProvider),
562
563
  keepAlive: keepAlive,
563
564
  authToken:authToken,
564
- clientVersion: "2.0.218",
565
+ clientVersion: "2.0",
565
566
  clientOSVersion: window.navigator.appVersion,
566
567
  clientBrowserVersion: window.navigator.userAgent,
567
568
  msePacketizationVersion: 2,
@@ -1721,6 +1722,14 @@ var createSession = function (options) {
1721
1722
  var stream = {};
1722
1723
 
1723
1724
  streamEventRefreshHandlers[id_] = function (streamEvent) {
1725
+ if (streamEvent.type == STREAM_EVENT_TYPE.NOT_ENOUGH_BANDWIDTH) {
1726
+ var info = streamEvent.payload.info.split("/");
1727
+ remoteBitrate = info[0];
1728
+ networkBandwidth = info[1];
1729
+ } else if (streamEvent.type == STREAM_EVENT_TYPE.RESIZE) {
1730
+ resolution.width = streamEvent.payload.streamerVideoWidth;
1731
+ resolution.height = streamEvent.payload.streamerVideoHeight;
1732
+ }
1724
1733
  if (callbacks[STREAM_EVENT]) {
1725
1734
  callbacks[STREAM_EVENT](streamEvent);
1726
1735
  }
@@ -1757,6 +1766,7 @@ var createSession = function (options) {
1757
1766
  return;
1758
1767
  }
1759
1768
 
1769
+ //Depricated. WCS-3228: RESIZE, SNAPSHOT_COMPLETE and NOT_ENOUGH_BANDWIDTH moved to STREAM_EVENT
1760
1770
  if (event == STREAM_STATUS.RESIZE) {
1761
1771
  resolution.width = streamInfo.streamerVideoWidth;
1762
1772
  resolution.height = streamInfo.streamerVideoHeight;