@flashphoner/websdk 2.0.240 → 2.0.241

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.240",
3
+ "version": "2.0.241",
4
4
  "description": "Official Flashphoner WebCallServer WebSDK package",
5
5
  "main": "./src/flashphoner-core.js",
6
6
  "types": "./src/flashphoner-core.d.ts",
@@ -1790,18 +1790,25 @@ var createSession = function (options) {
1790
1790
 
1791
1791
  var event = streamInfo.status;
1792
1792
 
1793
- if (event == INBOUND_VIDEO_RATE || event == OUTBOUND_VIDEO_RATE) {
1793
+ if (event === INBOUND_VIDEO_RATE || event === OUTBOUND_VIDEO_RATE) {
1794
1794
  detectConnectionQuality(event, streamInfo);
1795
1795
  return;
1796
1796
  }
1797
1797
 
1798
- //Depricated. WCS-3228: RESIZE, SNAPSHOT_COMPLETE and NOT_ENOUGH_BANDWIDTH moved to STREAM_EVENT
1799
- if (event == STREAM_STATUS.RESIZE) {
1798
+ if (event === STREAM_EVENT) {
1799
+ if (!streamInfo.mediaSessionId)
1800
+ streamInfo.mediaSessionId = id_;
1801
+ streamEventRefreshHandlers[id_](streamInfo);
1802
+ return;
1803
+ }
1804
+
1805
+ //Deprecated. WCS-3228: RESIZE, SNAPSHOT_COMPLETE and NOT_ENOUGH_BANDWIDTH moved to STREAM_EVENT
1806
+ if (event === STREAM_STATUS.RESIZE) {
1800
1807
  resolution.width = streamInfo.streamerVideoWidth;
1801
1808
  resolution.height = streamInfo.streamerVideoHeight;
1802
- } else if (event == STREAM_STATUS.SNAPSHOT_COMPLETE) {
1809
+ } else if (event === STREAM_STATUS.SNAPSHOT_COMPLETE) {
1803
1810
 
1804
- } else if (event == STREAM_STATUS.NOT_ENOUGH_BANDWIDTH) {
1811
+ } else if (event === STREAM_STATUS.NOT_ENOUGH_BANDWIDTH) {
1805
1812
  var info = streamInfo.info.split("/");
1806
1813
  remoteBitrate = info[0];
1807
1814
  networkBandwidth = info[1];
@@ -1809,15 +1816,17 @@ var createSession = function (options) {
1809
1816
  status_ = event;
1810
1817
  }
1811
1818
 
1812
- audioState_ = streamInfo.audioState;
1813
- videoState_ = streamInfo.videoState;
1819
+ if (streamInfo.audioState)
1820
+ audioState_ = streamInfo.audioState;
1821
+ if (streamInfo.videoState)
1822
+ videoState_ = streamInfo.videoState;
1814
1823
 
1815
1824
  if (streamInfo.info)
1816
1825
  info_ = streamInfo.info;
1817
1826
 
1818
1827
  //release stream
1819
- if (event == STREAM_STATUS.FAILED || event == STREAM_STATUS.STOPPED ||
1820
- event == STREAM_STATUS.UNPUBLISHED) {
1828
+ if (event === STREAM_STATUS.FAILED || event === STREAM_STATUS.STOPPED ||
1829
+ event === STREAM_STATUS.UNPUBLISHED) {
1821
1830
 
1822
1831
  delete streams[id_];
1823
1832
  delete streamRefreshHandlers[id_];
@@ -1920,7 +1929,8 @@ var createSession = function (options) {
1920
1929
  playoutDelay: playoutDelay,
1921
1930
  unmutePlayOnStart: unmutePlayOnStart,
1922
1931
  useControls: useControls,
1923
- logger: logger
1932
+ logger: logger,
1933
+ unmuteRequiredEvent: fireUnmuteEvent
1924
1934
  }, streamRefreshHandlers[id_]).then(function (newConnection) {
1925
1935
  mediaConnection = newConnection;
1926
1936
  try {
@@ -2599,6 +2609,14 @@ var createSession = function (options) {
2599
2609
  return streamLogger;
2600
2610
  };
2601
2611
 
2612
+ var fireUnmuteEvent = function() {
2613
+ if (isRemoteAudioMuted()) {
2614
+ if (streamRefreshHandlers[id_] && typeof streamRefreshHandlers[id_] === 'function') {
2615
+ streamRefreshHandlers[id_]({status: STREAM_EVENT, type: STREAM_EVENT_TYPE.UNMUTE_REQUIRED});
2616
+ }
2617
+ }
2618
+ };
2619
+
2602
2620
  stream.play = play;
2603
2621
  stream.publish = publish;
2604
2622
  stream.stop = stop;