zby-live-sdk 1.0.49-beta20230302 → 1.0.49-beta20230324

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": "zby-live-sdk",
3
- "version": "1.0.49-beta20230302",
3
+ "version": "1.0.49-beta20230324",
4
4
  "main": "dist/zby-live-sdk.cjs.js",
5
5
  "module": "dist/zby-live-sdk.esm.js",
6
6
  "browsers": "dist/zby-live-sdk.umd.js",
@@ -21,8 +21,8 @@ const pomeloObj = {
21
21
  return;
22
22
  }
23
23
  this.log('channel_log : start joining pomelo ......');
24
- const { userId, roomId, chatUrl, userName, role, institutionId, guid} = args;
25
- const _args = { userId, roomId, host: chatUrl, userName, institutionId, guid, role: polemoUtil.translateRole(role) };
24
+ const { userId, roomId, chatUrl, userName, role, institutionId, guid, orgId} = args;
25
+ const _args = { userId, roomId, host: chatUrl, userName, institutionId, guid, role: polemoUtil.translateRole(role), orgId};
26
26
  this.log(`joinRoom: args: ${JSON.stringify(_args)}`);
27
27
  this.initParams = _args;
28
28
  // 定时检查发送消息列表
@@ -628,7 +628,8 @@ class PomeloClient {
628
628
  role: channelInfo.role,
629
629
  classid: channelInfo.roomId,
630
630
  protocolVersion: '1.0',
631
- uniqId: channelInfo.guid
631
+ uniqId: channelInfo.guid,
632
+ orgId: channelInfo.orgId
632
633
  };
633
634
 
634
635
  return new Promise(async (resolve, reject) => {
@@ -13,7 +13,7 @@ const urls = {
13
13
  };
14
14
 
15
15
  // export const version = require('../../package.json').version;
16
- export const version = '1.0.49-beta20230302';
16
+ export const version = '1.0.49-beta20230324';
17
17
 
18
18
  export const liveExt = {
19
19
  name: 'live',
@@ -269,6 +269,13 @@ export default {
269
269
  event_content:{...args}
270
270
  });
271
271
  },
272
+ //推拉流事件
273
+ streamEvent(args){
274
+ dataReport({
275
+ event_name: 'on_stream_event',
276
+ event_content:{...args}
277
+ });
278
+ },
272
279
  //退出教室
273
280
  leaveRoom(args){
274
281
  dataReport({
package/src/notice.js CHANGED
@@ -168,6 +168,20 @@ export default {
168
168
  data
169
169
  });
170
170
  },
171
+ // SDK自动重试推流成功
172
+ retryPushFlowSuccess(data) {
173
+ notice({
174
+ type:'retryPushFlowSuccess',
175
+ data
176
+ });
177
+ },
178
+ // SDK自动重试拉流成功
179
+ retryPullFlowSuccess(data) {
180
+ notice({
181
+ type:'retryPullFlowSuccess',
182
+ data
183
+ });
184
+ },
171
185
  pullFlowResult(data) {
172
186
  notice({
173
187
  type:'pullFlowResult',
@@ -272,6 +272,39 @@ const addListener = (userId, userName, confId, nNetType, devices) => {
272
272
  }
273
273
  }
274
274
  break;
275
+ case 'OnStreamEvent':
276
+ {
277
+ let res = JSON.parse(data);
278
+ let keys = Object.keys(res);
279
+ if (keys.indexOf('event') > -1) {
280
+ switch (res.event) {
281
+ case 104:
282
+ try {
283
+ NOTICE.retryPushFlowSuccess({code:0,publish_streamid: _data.pszStreamID});
284
+ } catch (e) {};
285
+ break;
286
+ case 204:
287
+ try {
288
+ NOTICE.retryPullFlowSuccess({code:0,publish_streamid: _data.pszStreamID});
289
+ } catch (e) {};
290
+ break;
291
+ default:
292
+ break;
293
+ }
294
+ // 103开始重试推流, 104重试推流成功,105重试推流失败,203开始重试拉流,204重试拉流成功,205重试拉流失败
295
+ try {
296
+ let ReportArgs = {};
297
+ ReportArgs.streamevent = res.event;
298
+ if(_data.pszStreamID.split('_').length == 5 ){
299
+ ReportArgs.streamid = _data.pszStreamID;
300
+ }
301
+ dataReport.streamEvent({
302
+ code: '0',
303
+ ...ReportArgs
304
+ });
305
+ } catch (e) {};
306
+ }
307
+ }
275
308
  case 'OnPublishQualityUpdate':
276
309
  if (_data.hasOwnProperty('pq') && (_data.pszStreamID).split('_').length != 5) {
277
310
  // 主辅两路质量回调,丢包延时只上抛一次,过滤掉辅路数据