agora-rte-sdk 3.10.1 → 3.10.5

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.
@@ -186,7 +186,7 @@ var AgoraRteStreamPlayer = exports.AgoraRteStreamPlayer = /*#__PURE__*/function
186
186
  key: "takeSnapshot",
187
187
  value: function () {
188
188
  var _takeSnapshot = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(streamId, filePath) {
189
- var _yield$this$_rtcChann, data, type;
189
+ var _yield$this$_rtcChann, data, type, imageData;
190
190
  return _regenerator["default"].wrap(function (_context) {
191
191
  while (1) switch (_context.prev = _context.next) {
192
192
  case 0:
@@ -196,13 +196,26 @@ var AgoraRteStreamPlayer = exports.AgoraRteStreamPlayer = /*#__PURE__*/function
196
196
  _yield$this$_rtcChann = _context.sent;
197
197
  data = _yield$this$_rtcChann.data;
198
198
  type = _yield$this$_rtcChann.type;
199
+ if (!(type === 'filepath')) {
200
+ _context.next = 2;
201
+ break;
202
+ }
199
203
  return _context.abrupt("return", Promise.resolve({
200
- streamId: '',
201
- filePath: '',
204
+ streamId: streamId,
205
+ filePath: data,
202
206
  width: 0,
203
207
  height: 0
204
208
  }));
205
209
  case 2:
210
+ imageData = data;
211
+ return _context.abrupt("return", Promise.resolve({
212
+ streamId: streamId,
213
+ filePath: filePath,
214
+ width: imageData.width,
215
+ height: imageData.height,
216
+ imageData: imageData
217
+ }));
218
+ case 3:
206
219
  case "end":
207
220
  return _context.stop();
208
221
  }
@@ -446,6 +446,7 @@ export type AgoraRteSnapshotInfo = {
446
446
  filePath: string;
447
447
  width: number;
448
448
  height: number;
449
+ imageData?: ImageData;
449
450
  };
450
451
  export type AgoraRteUserPageRequest = {
451
452
  userRole: number;
@@ -397,9 +397,10 @@ var AgoraRtcChannelWebAdapterImp = exports.AgoraRtcChannelWebAdapterImp = /*#__P
397
397
  }, {
398
398
  key: "takeSnapshot",
399
399
  value: function takeSnapshot(streamId, filePath) {
400
+ var imageData = this.subscriber.takeSnapshot(streamId);
400
401
  return Promise.resolve({
401
402
  type: 'imageData',
402
- data: this.subscriber.takeSnapshot(streamId)
403
+ data: imageData
403
404
  });
404
405
  }
405
406
  }, {
@@ -179,7 +179,7 @@ export var AgoraRteStreamPlayer = /*#__PURE__*/function () {
179
179
  key: "takeSnapshot",
180
180
  value: function () {
181
181
  var _takeSnapshot = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(streamId, filePath) {
182
- var _yield$this$_rtcChann, data, type;
182
+ var _yield$this$_rtcChann, data, type, imageData;
183
183
  return _regeneratorRuntime.wrap(function (_context) {
184
184
  while (1) switch (_context.prev = _context.next) {
185
185
  case 0:
@@ -189,13 +189,26 @@ export var AgoraRteStreamPlayer = /*#__PURE__*/function () {
189
189
  _yield$this$_rtcChann = _context.sent;
190
190
  data = _yield$this$_rtcChann.data;
191
191
  type = _yield$this$_rtcChann.type;
192
+ if (!(type === 'filepath')) {
193
+ _context.next = 2;
194
+ break;
195
+ }
192
196
  return _context.abrupt("return", Promise.resolve({
193
- streamId: '',
194
- filePath: '',
197
+ streamId: streamId,
198
+ filePath: data,
195
199
  width: 0,
196
200
  height: 0
197
201
  }));
198
202
  case 2:
203
+ imageData = data;
204
+ return _context.abrupt("return", Promise.resolve({
205
+ streamId: streamId,
206
+ filePath: filePath,
207
+ width: imageData.width,
208
+ height: imageData.height,
209
+ imageData: imageData
210
+ }));
211
+ case 3:
199
212
  case "end":
200
213
  return _context.stop();
201
214
  }
@@ -390,9 +390,10 @@ export var AgoraRtcChannelWebAdapterImp = /*#__PURE__*/function (_AgoraRtcChanne
390
390
  }, {
391
391
  key: "takeSnapshot",
392
392
  value: function takeSnapshot(streamId, filePath) {
393
+ var imageData = this.subscriber.takeSnapshot(streamId);
393
394
  return Promise.resolve({
394
395
  type: 'imageData',
395
- data: this.subscriber.takeSnapshot(streamId)
396
+ data: imageData
396
397
  });
397
398
  }
398
399
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-rte-sdk",
3
- "version": "3.10.1",
3
+ "version": "3.10.5",
4
4
  "description": "SDK for building interactive scenarios",
5
5
  "author": "agora.io",
6
6
  "license": "ISC",
@@ -29,7 +29,7 @@
29
29
  "@types/sinon": "^17.0.2",
30
30
  "@types/ua-parser-js": "^0.7.35",
31
31
  "agora-token": "^2.0.3",
32
- "agora-toolchain": "3.10.1",
32
+ "agora-toolchain": "3.10.5",
33
33
  "core-js": "^3.33.3",
34
34
  "electron": "22.3.27",
35
35
  "husky": "^9.0.11",
@@ -44,7 +44,7 @@
44
44
  "agora-extension-ai-denoiser": "^1.0.0",
45
45
  "agora-extension-beauty-effect": "^1.0.1-beta",
46
46
  "agora-extension-virtual-background": "^2.1.0",
47
- "agora-foundation": "3.10.1",
47
+ "agora-foundation": "3.10.5",
48
48
  "agora-rtc-sdk-ng": "4.23.3",
49
49
  "agora-rtm": "2.2.2-3",
50
50
  "await-to-js": "^3.0.0",