@flashphoner/websdk 2.0.256 → 2.0.258

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.256",
3
+ "version": "2.0.258",
4
4
  "description": "Official Flashphoner WebCallServer WebSDK package",
5
5
  "main": "./src/flashphoner-core.js",
6
6
  "types": "./src/flashphoner-core.d.ts",
@@ -639,6 +639,12 @@ export const ERROR_INFO: Readonly<{
639
639
  * @memberOf Flashphoner.constants.ERROR_INFO
640
640
  */
641
641
  CAN_NOT_SWITCH_MIC: string;
642
+ /**
643
+ * Error if cannot set a new resolution to the published track
644
+ * @event CAN_NOT_SET_RESOLUTION
645
+ * @memberOf Flashphoner.constants.ERROR_INFO
646
+ */
647
+ CAN_NOT_SET_RESOLUTION: string;
642
648
  /**
643
649
  * Local browser error detected
644
650
  * @event LOCAL_ERROR
package/src/constants.js CHANGED
@@ -648,6 +648,12 @@ const ERROR_INFO = Object.freeze({
648
648
  * @memberOf Flashphoner.constants.ERROR_INFO
649
649
  */
650
650
  CAN_NOT_SWITCH_MIC: 'Number of mics is less than 2 or microphone is already used by other application',
651
+ /**
652
+ * Error if cannot set a new resolution to the published track
653
+ * @event CAN_NOT_SET_RESOLUTION
654
+ * @memberOf Flashphoner.constants.ERROR_INFO
655
+ */
656
+ CAN_NOT_SET_RESOLUTION: 'Cannot switch a published stream resolution',
651
657
  /**
652
658
  * Local browser error detected
653
659
  * @event LOCAL_ERROR
@@ -78,6 +78,8 @@ export declare class Stream {
78
78
  switchToCam: () => void;
79
79
  sendData: (payload: any) => void;
80
80
  getLogger: () => any;
81
+ updateVideoSettings: (settings: any) => any;
82
+ updateVideoResolution: (resolution: any) => any
81
83
  }
82
84
 
83
85
  export declare class CreateStreamOptions {
@@ -2655,6 +2655,36 @@ var createSession = function (options) {
2655
2655
  }
2656
2656
  };
2657
2657
 
2658
+ /**
2659
+ * Update video publishing settings on the fly
2660
+ *
2661
+ * @param {Object} stream video settings: {maxBitrate, frameRate, scaleResolutionDownBy)}
2662
+ * @return {Promice} encodings object applied
2663
+ * @memberof Stream
2664
+ */
2665
+ var updateVideoSettings = function(settings) {
2666
+ if (published() && mediaConnection) {
2667
+ return mediaConnection.updateVideoSettings(settings);
2668
+ } else {
2669
+ throw new Error("This function available for publishing stream only");
2670
+ }
2671
+ };
2672
+
2673
+ /**
2674
+ * Update video publishing resolution on the fly
2675
+ *
2676
+ * @param {Object} stream video resolution: {width, height)}
2677
+ * @return {Promice} video constaints object applied
2678
+ * @memberof Stream
2679
+ */
2680
+ var updateVideoResolution = function(resolution) {
2681
+ if (published() && mediaConnection) {
2682
+ return mediaConnection.updateVideoResolution(resolution);
2683
+ } else {
2684
+ throw new Error("This function available for publishing stream only");
2685
+ }
2686
+ };
2687
+
2658
2688
  stream.play = play;
2659
2689
  stream.publish = publish;
2660
2690
  stream.stop = stop;
@@ -2694,6 +2724,8 @@ var createSession = function (options) {
2694
2724
  stream.switchToCam = switchToCam;
2695
2725
  stream.sendData = sendData;
2696
2726
  stream.getLogger = getLogger;
2727
+ stream.updateVideoSettings = updateVideoSettings;
2728
+ stream.updateVideoResolution = updateVideoResolution;
2697
2729
 
2698
2730
  streams[id_] = stream;
2699
2731
  return stream;