@flashphoner/websdk 2.0.257 → 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.
@@ -1,4 +1,4 @@
1
- Web SDK - 2.0.257
1
+ Web SDK - 2.0.258
2
2
 
3
3
  [Download builds](https://docs.flashphoner.com/display/WEBSDK2EN/Web+SDK+release+notes)
4
4
 
@@ -202,6 +202,9 @@ function onUnpublished() {
202
202
  publishStatsIntervalID = null;
203
203
  }
204
204
  enablePublishToggles(false);
205
+ $("#resolutionBtn").prop('disabled', true);
206
+ $("#fpsBtn").prop('disabled', true);
207
+ $("#bitrateBtn").prop('disabled', true);
205
208
  }
206
209
 
207
210
  function publishBtnClick() {
@@ -239,6 +242,46 @@ function onPublishing(stream) {
239
242
  });
240
243
  }).prop('disabled', !($('#sendAudio').is(':checked')));
241
244
  stream.setVolume(currentVolumeValue);
245
+ $("#resolutionBtn").off('click').click(function () {
246
+ onResolutionClick(stream);
247
+ }).prop('disabled', false);
248
+ $("#fpsBtn").off('click').click(function () {
249
+ onFpsClick(stream);
250
+ }).prop('disabled', false);
251
+ $("#bitrateBtn").off('click').click(function () {
252
+ onBitrateClick(stream);
253
+ }).prop('disabled', false);
254
+ }
255
+
256
+ function onResolutionClick(stream) {
257
+ stream.updateVideoResolution({
258
+ width: parseInt($('#sendWidth').val()),
259
+ height: parseInt($('#sendHeight').val())
260
+ }).then(function(constraints) {
261
+ console.log("Publishing video constraints changed to " + JSON.stringify(constraints));
262
+ }).catch(function(e) {
263
+ console.error("Error " + e);
264
+ });
265
+ }
266
+
267
+ function onBitrateClick(stream) {
268
+ stream.updateVideoSettings({
269
+ maxBitrate: parseInt($('#sendVideoMaxBitrate').val())
270
+ }).then(function(encodings) {
271
+ console.log("Publishing video encoder parameters changed to " + JSON.stringify(encodings));
272
+ }).catch(function(e) {
273
+ console.error("Error " + e);
274
+ });
275
+ }
276
+
277
+ function onFpsClick(stream) {
278
+ stream.updateVideoSettings({
279
+ frameRate: parseInt($('#fps').val())
280
+ }).then(function(encodings) {
281
+ console.log("Publishing video encoder parameters changed to " + JSON.stringify(encodings));
282
+ }).catch(function(e) {
283
+ console.error("Error " + e);
284
+ });
242
285
  }
243
286
 
244
287
  function onPlaying(stream) {
@@ -552,7 +595,12 @@ function setStatus(selector, status, stream) {
552
595
 
553
596
  function muteInputs(selector) {
554
597
  $('[class*=group][id^=' + selector + ']').find('input').each(function () {
555
- if ($(this).attr('id') !== 'audioOutput') {
598
+ if ($(this).attr('id') !== 'audioOutput' &&
599
+ $(this).attr('id') !== 'sendWidth' &&
600
+ $(this).attr('id') !== 'sendHeight' &&
601
+ $(this).attr('id') !== 'fps' &&
602
+ $(this).attr('id') !== 'sendVideoMinBitrate' &&
603
+ $(this).attr('id') !== 'sendVideoMaxBitrate') {
556
604
  $(this).prop('disabled', true);
557
605
  }
558
606
  });
@@ -579,8 +627,7 @@ function unmuteInputs(selector) {
579
627
 
580
628
 
581
629
  function resizeLocalVideo(event) {
582
- var requested = constraints.video;
583
- if (requested.width != event.target.videoWidth || requested.height != event.target.videoHeight) {
630
+ if (parseInt($('#sendWidth').val()) != event.target.videoWidth || parseInt($('#sendHeight').val()) != event.target.videoHeight) {
584
631
  console.warn("Camera does not support requested resolution, actual resolution is " + event.target.videoWidth + "x" + event.target.videoHeight);
585
632
  }
586
633
  $("#publishResolution").text(event.target.videoWidth + "x" + event.target.videoHeight);
@@ -202,17 +202,27 @@
202
202
  <div class="form-group" id="sendSizeForm">
203
203
  <label style="text-align: left" class="col-sm-4 control-label">Size</label>
204
204
  <div class="col-sm-4">
205
+ <span>width</span>
205
206
  <input type="text" class="form-control" id="sendWidth" value="640">
206
207
  </div>
207
208
  <div class="col-sm-4">
209
+ <span>height</span>
208
210
  <input type="text" class="form-control" id="sendHeight" value="480">
209
211
  </div>
212
+ <label style="text-align: left" class="col-sm-4 control-label"></label>
213
+ <div class="col-sm-8">
214
+ <button type="button" class="btn btn-default form-control" id="resolutionBtn">Apply</button>
215
+ </div>
216
+
210
217
  </div>
211
218
  <div class="form-group" id="fpsForm">
212
219
  <label style="text-align: left" class="col-sm-4 control-label">FPS</label>
213
220
  <div class="col-sm-4">
214
221
  <input type="text" class="form-control" id="fps" value="30">
215
222
  </div>
223
+ <div class="col-sm-4">
224
+ <button type="button" class="btn btn-default form-control" id="fpsBtn">Apply</button>
225
+ </div>
216
226
  </div>
217
227
  <div class="form-group" id="sendBitrateForm">
218
228
  <label style="text-align: left" class="col-sm-4 control-label">Bitrate</label>
@@ -224,6 +234,10 @@
224
234
  <span>max</span>
225
235
  <input type="text" class="form-control" id="sendVideoMaxBitrate" value="0">
226
236
  </div>
237
+ <label style="text-align: left" class="col-sm-4 control-label"></label>
238
+ <div class="col-sm-8">
239
+ <button type="button" class="btn btn-default form-control" id="bitrateBtn">Apply</button>
240
+ </div>
227
241
  </div>
228
242
  <div class="form-group" id="cpuOveruseDetectionForm">
229
243
  <label style="text-align: left" class="col-sm-4 control-label" for="cpuOveruseDetectionForm">COD