@flashphoner/websdk 2.0.232 → 2.0.233

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.232
1
+ Web SDK - 2.0.233
2
2
 
3
3
  [Download builds](https://docs.flashphoner.com/display/WEBSDK2EN/Web+SDK+release+notes)
4
4
 
@@ -53,6 +53,7 @@
53
53
  <button id="pullRtspStreamModalBtn" data-toggle='modal' data-target='#pullRtspModal' type="button" class="btn btn-default btn-success btn-block">Pull RTSP stream</button>
54
54
  <hr>
55
55
  <button id="pullStreamBatchModalBtn" data-toggle='modal' data-target='#pullStreamBatchModal' type="button" class="btn btn-default btn-success btn-block">Pull streams</button>
56
+ <button id="pushStreamBatchModalBtn" data-toggle='modal' data-target='#pushStreamBatchModal' type="button" class="btn btn-default btn-success btn-block">Push streams</button>
56
57
  <button id="registerBatchModalBtn" data-toggle='modal' data-target='#registerBatchModal' type="button" class="btn btn-default btn-success btn-block">Register</button>
57
58
  <button id="unregisterBatchModalBtn" data-toggle='modal' data-target='#unregisterBatchModal' type="button" class="btn btn-default btn-success btn-block">Unregister</button>
58
59
  <button id="callBatchModalBtn" data-toggle='modal' data-target='#callBatchModal' type="button" class="btn btn-default btn-success btn-block">Call</button>
@@ -200,7 +201,7 @@
200
201
  </select>
201
202
  </div>
202
203
  <div class="form-group">
203
- <label for="pullStreamBatchNodes"><span class="glyphicon glyphicon-play-circle"></span> Proto pull</label>
204
+ <label for="pullStreamBatchProto"><span class="glyphicon glyphicon-play-circle"></span> Proto pull</label>
204
205
  <select class="custom-select" id="pullStreamBatchProto">
205
206
  <option value="ws" selected>WebRTC</option>
206
207
  <option value="rtmp">RTMP</option>
@@ -227,6 +228,48 @@
227
228
  </div>
228
229
  </div>
229
230
  </div>
231
+ <div id="pushStreamBatchModal" class="modal fade" role="dialog">
232
+ <div class="modal-dialog">
233
+ <div class="modal-content">
234
+ <div class="modal-header">
235
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
236
+ <h4>Push Streams</h4>
237
+ </div>
238
+ <div class="modal-body">
239
+ <form action="" id="pushStreamBatchForm">
240
+ <div class="form-group">
241
+ <label for="pushStreamBatchNodes"><span class="glyphicon glyphicon-globe"></span> Choose node</label>
242
+ <select class="custom-select" id="pushStreamBatchNodes">
243
+ </select>
244
+ </div>
245
+ <div class="form-group">
246
+ <label for="pushStreamBatchProto"><span class="glyphicon glyphicon-play-circle"></span> Proto push</label>
247
+ <select class="custom-select" id="pushStreamBatchProto">
248
+ <option value="ws" selected>WebRTC</option>
249
+ <option value="rtmp">RTMP</option>
250
+ </select>
251
+ </div>
252
+ <div class="form-group">
253
+ <label for="pushBatchLocalName"><span class="glyphicon glyphicon-play-circle"></span> Local stream name</label>
254
+ <input type="text" class="form-control" id="pushBatchLocalName" placeholder="my_local_stream">
255
+ </div>
256
+ <div class="form-group">
257
+ <label for="pushBatchRemoteName"><span class="glyphicon glyphicon-play-circle"></span> Remote stream name</label>
258
+ <input type="text" class="form-control" id="pushBatchRemoteName" placeholder="my_remote_stream">
259
+ </div>
260
+ <div class="form-group">
261
+ <label for="pushBatchQty"><span class="glyphicon glyphicon-plus"></span> Qty</label>
262
+ <input type="text" class="form-control" id="pushBatchQty" placeholder="1">
263
+ </div>
264
+ <button id="pushBatchStream" type="button" class="btn btn-default btn-success btn-block"><span class="glyphicon glyphicon-off"></span> Push</button>
265
+ </form>
266
+ </div>
267
+ <div class="modal-footer">
268
+ <button type="button" class="btn btn-default pull-left" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cancel</button>
269
+ </div>
270
+ </div>
271
+ </div>
272
+ </div>
230
273
  <div id="registerBatchModal" class="modal fade" role="dialog">
231
274
  <div class="modal-dialog">
232
275
  <div class="modal-content">
@@ -67,9 +67,15 @@ $(function() {
67
67
  $('#pullStreamBatchModal').on('show.bs.modal', function(e) {
68
68
  populateNodes($("#pullStreamBatchNodes"));
69
69
  });
70
+ $('#pushStreamBatchModal').on('show.bs.modal', function(e) {
71
+ populateNodes($("#pushStreamBatchNodes"));
72
+ });
70
73
  $("#pullBatchStream").on("click", function(e){
71
74
  pullStreamBatch();
72
75
  });
76
+ $("#pushBatchStream").on("click", function(e){
77
+ pushStreamBatch();
78
+ });
73
79
  $('#registerBatchModal').on('show.bs.modal', function(e) {
74
80
  populateNodes($("#registerBatchNodes"));
75
81
  });
@@ -485,6 +491,37 @@ function pullStreamBatch() {
485
491
  $("#pullStreamBatchModal").modal('hide');
486
492
  }
487
493
 
494
+ function pushStreamBatch() {
495
+ if (!$("#pushStreamBatchNodes").val()) {
496
+ $('#warningModal').modal();
497
+ return false;
498
+ }
499
+ var node = getActiveNode();
500
+ var proto = $("#pushStreamBatchProto").val();
501
+ var localName = $("#pushBatchLocalName").val();
502
+ var remoteName = $("#pushBatchRemoteName").val();
503
+ var remote;
504
+ if (proto == "ws") {
505
+ remote = getWebsocketUrl($("#pushStreamBatchNodes").val()) + "/";
506
+ } else {
507
+ remote = "rtmp://" + $("#pushStreamBatchNodes").val() + ":1935/live/";
508
+ }
509
+ var qty = parseInt($("#pushBatchQty").val());
510
+ var interval = setInterval(function(){
511
+ if (qty > 0) {
512
+ if (proto == "ws") {
513
+ node.pull.push(remote, localName, remoteName + qty).catch(function (e) {console.log(e)});
514
+ } else {
515
+ node.push.push(localName, remote + remoteName + qty, true);
516
+ }
517
+ qty--;
518
+ } else {
519
+ clearInterval(interval);
520
+ }
521
+ }, 200);
522
+ $("#pushStreamBatchModal").modal('hide');
523
+ }
524
+
488
525
  function registerBatch() {
489
526
  if (!$("#registerBatchNodes").val()) {
490
527
  $('#warningModal').modal();