android-emulator-webrtc 1.0.16 → 1.0.17

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.
Files changed (31) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/api_descriptor.pb +0 -0
  3. package/dist/components/emulator/emulator.js +43 -56
  4. package/dist/components/emulator/net/emulator_status.js +15 -23
  5. package/dist/components/emulator/net/jsep_protocol_driver.js +54 -104
  6. package/dist/components/emulator/net/logcat.js +34 -34
  7. package/dist/components/emulator/views/event_handler.js +57 -75
  8. package/dist/components/emulator/views/resizing_component.js +86 -0
  9. package/dist/components/emulator/views/simple_png_view.js +90 -206
  10. package/dist/components/emulator/views/webrtc_view.js +110 -174
  11. package/dist/index.js +4 -8
  12. package/dist/proto/emulator_controller_grpc_web_pb.js +454 -634
  13. package/dist/proto/emulator_controller_pb.js +4620 -3945
  14. package/dist/proto/emulator_web_client.js +26 -56
  15. package/dist/proto/rtc_service_grpc_web_pb.js +35 -101
  16. package/dist/proto/rtc_service_pb.js +31 -88
  17. package/package.json +25 -21
  18. package/proto/README.MD +1 -1
  19. package/proto/emulator_controller.proto +1090 -804
  20. package/protoc-plugin/grpc_generator.cc +661 -549
  21. package/src/components/emulator/emulator.js +3 -10
  22. package/src/components/emulator/net/jsep_protocol_driver.js +0 -2
  23. package/src/components/emulator/views/resizing_component.js +65 -0
  24. package/src/components/emulator/views/simple_png_view.js +81 -134
  25. package/src/components/emulator/views/webrtc_view.js +87 -95
  26. package/test/emulator.test.js +7 -7
  27. package/test/event_handler.test.js +3 -0
  28. package/test/jsep_protocol_driver.test.js +3 -0
  29. package/test/resizing_component.test.js +37 -0
  30. package/test/simple_png_view.test.js +54 -42
  31. package/test/touch_event_handler.test.js +3 -1
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  // source: rtc_service.proto
4
-
5
4
  /**
6
5
  * @fileoverview
7
6
  * @enhanceable
@@ -10,13 +9,11 @@
10
9
  * @public
11
10
  */
12
11
  // GENERATED CODE -- DO NOT EDIT!
13
- var jspb = require('google-protobuf');
14
12
 
13
+ var jspb = require('google-protobuf');
15
14
  var goog = jspb;
16
15
  var global = Function('return this')();
17
-
18
16
  var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
19
-
20
17
  goog.object.extend(proto, google_protobuf_empty_pb);
21
18
  goog.exportSymbol('proto.android.emulation.control.JsepMsg', null, global);
22
19
  goog.exportSymbol('proto.android.emulation.control.RtcId', null, global);
@@ -30,13 +27,10 @@ goog.exportSymbol('proto.android.emulation.control.RtcId', null, global);
30
27
  * @extends {jspb.Message}
31
28
  * @constructor
32
29
  */
33
-
34
30
  proto.android.emulation.control.RtcId = function (opt_data) {
35
31
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
36
32
  };
37
-
38
33
  goog.inherits(proto.android.emulation.control.RtcId, jspb.Message);
39
-
40
34
  if (goog.DEBUG && !COMPILED) {
41
35
  /**
42
36
  * @public
@@ -54,14 +48,10 @@ if (goog.DEBUG && !COMPILED) {
54
48
  * @extends {jspb.Message}
55
49
  * @constructor
56
50
  */
57
-
58
-
59
51
  proto.android.emulation.control.JsepMsg = function (opt_data) {
60
52
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
61
53
  };
62
-
63
54
  goog.inherits(proto.android.emulation.control.JsepMsg, jspb.Message);
64
-
65
55
  if (goog.DEBUG && !COMPILED) {
66
56
  /**
67
57
  * @public
@@ -69,7 +59,6 @@ if (goog.DEBUG && !COMPILED) {
69
59
  */
70
60
  proto.android.emulation.control.JsepMsg.displayName = 'proto.android.emulation.control.JsepMsg';
71
61
  }
72
-
73
62
  if (jspb.Message.GENERATE_TO_OBJECT) {
74
63
  /**
75
64
  * Creates an object representation of this proto.
@@ -86,6 +75,7 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
86
75
  proto.android.emulation.control.RtcId.prototype.toObject = function (opt_includeInstance) {
87
76
  return proto.android.emulation.control.RtcId.toObject(opt_includeInstance, this);
88
77
  };
78
+
89
79
  /**
90
80
  * Static version of the {@see toObject} method.
91
81
  * @param {boolean|undefined} includeInstance Deprecated. Whether to include
@@ -95,33 +85,29 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
95
85
  * @return {!Object}
96
86
  * @suppress {unusedLocalVariables} f is only used for nested messages
97
87
  */
98
-
99
-
100
88
  proto.android.emulation.control.RtcId.toObject = function (includeInstance, msg) {
101
89
  var f,
102
- obj = {
103
- guid: jspb.Message.getFieldWithDefault(msg, 1, "")
104
- };
105
-
90
+ obj = {
91
+ guid: jspb.Message.getFieldWithDefault(msg, 1, "")
92
+ };
106
93
  if (includeInstance) {
107
94
  obj.$jspbMessageInstance = msg;
108
95
  }
109
-
110
96
  return obj;
111
97
  };
112
98
  }
99
+
113
100
  /**
114
101
  * Deserializes binary data (in protobuf wire format).
115
102
  * @param {jspb.ByteSource} bytes The bytes to deserialize.
116
103
  * @return {!proto.android.emulation.control.RtcId}
117
104
  */
118
-
119
-
120
105
  proto.android.emulation.control.RtcId.deserializeBinary = function (bytes) {
121
106
  var reader = new jspb.BinaryReader(bytes);
122
107
  var msg = new proto.android.emulation.control.RtcId();
123
108
  return proto.android.emulation.control.RtcId.deserializeBinaryFromReader(msg, reader);
124
109
  };
110
+
125
111
  /**
126
112
  * Deserializes binary data (in protobuf wire format) from the
127
113
  * given reader into the given message object.
@@ -129,43 +115,35 @@ proto.android.emulation.control.RtcId.deserializeBinary = function (bytes) {
129
115
  * @param {!jspb.BinaryReader} reader The BinaryReader to use.
130
116
  * @return {!proto.android.emulation.control.RtcId}
131
117
  */
132
-
133
-
134
118
  proto.android.emulation.control.RtcId.deserializeBinaryFromReader = function (msg, reader) {
135
119
  while (reader.nextField()) {
136
120
  if (reader.isEndGroup()) {
137
121
  break;
138
122
  }
139
-
140
123
  var field = reader.getFieldNumber();
141
-
142
124
  switch (field) {
143
125
  case 1:
144
- var value =
145
- /** @type {string} */
146
- reader.readString();
126
+ var value = /** @type {string} */reader.readString();
147
127
  msg.setGuid(value);
148
128
  break;
149
-
150
129
  default:
151
130
  reader.skipField();
152
131
  break;
153
132
  }
154
133
  }
155
-
156
134
  return msg;
157
135
  };
136
+
158
137
  /**
159
138
  * Serializes the message to binary data (in protobuf wire format).
160
139
  * @return {!Uint8Array}
161
140
  */
162
-
163
-
164
141
  proto.android.emulation.control.RtcId.prototype.serializeBinary = function () {
165
142
  var writer = new jspb.BinaryWriter();
166
143
  proto.android.emulation.control.RtcId.serializeBinaryToWriter(this, writer);
167
144
  return writer.getResultBuffer();
168
145
  };
146
+
169
147
  /**
170
148
  * Serializes the given message to binary data (in protobuf wire
171
149
  * format), writing to the given BinaryWriter.
@@ -173,38 +151,30 @@ proto.android.emulation.control.RtcId.prototype.serializeBinary = function () {
173
151
  * @param {!jspb.BinaryWriter} writer
174
152
  * @suppress {unusedLocalVariables} f is only used for nested messages
175
153
  */
176
-
177
-
178
154
  proto.android.emulation.control.RtcId.serializeBinaryToWriter = function (message, writer) {
179
155
  var f = undefined;
180
156
  f = message.getGuid();
181
-
182
157
  if (f.length > 0) {
183
158
  writer.writeString(1, f);
184
159
  }
185
160
  };
161
+
186
162
  /**
187
163
  * optional string guid = 1;
188
164
  * @return {string}
189
165
  */
190
-
191
-
192
166
  proto.android.emulation.control.RtcId.prototype.getGuid = function () {
193
- return (
194
- /** @type {string} */
195
- jspb.Message.getFieldWithDefault(this, 1, "")
167
+ return (/** @type {string} */jspb.Message.getFieldWithDefault(this, 1, "")
196
168
  );
197
169
  };
170
+
198
171
  /**
199
172
  * @param {string} value
200
173
  * @return {!proto.android.emulation.control.RtcId} returns this
201
174
  */
202
-
203
-
204
175
  proto.android.emulation.control.RtcId.prototype.setGuid = function (value) {
205
176
  return jspb.Message.setProto3StringField(this, 1, value);
206
177
  };
207
-
208
178
  if (jspb.Message.GENERATE_TO_OBJECT) {
209
179
  /**
210
180
  * Creates an object representation of this proto.
@@ -221,6 +191,7 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
221
191
  proto.android.emulation.control.JsepMsg.prototype.toObject = function (opt_includeInstance) {
222
192
  return proto.android.emulation.control.JsepMsg.toObject(opt_includeInstance, this);
223
193
  };
194
+
224
195
  /**
225
196
  * Static version of the {@see toObject} method.
226
197
  * @param {boolean|undefined} includeInstance Deprecated. Whether to include
@@ -230,34 +201,30 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
230
201
  * @return {!Object}
231
202
  * @suppress {unusedLocalVariables} f is only used for nested messages
232
203
  */
233
-
234
-
235
204
  proto.android.emulation.control.JsepMsg.toObject = function (includeInstance, msg) {
236
205
  var f,
237
- obj = {
238
- id: (f = msg.getId()) && proto.android.emulation.control.RtcId.toObject(includeInstance, f),
239
- message: jspb.Message.getFieldWithDefault(msg, 2, "")
240
- };
241
-
206
+ obj = {
207
+ id: (f = msg.getId()) && proto.android.emulation.control.RtcId.toObject(includeInstance, f),
208
+ message: jspb.Message.getFieldWithDefault(msg, 2, "")
209
+ };
242
210
  if (includeInstance) {
243
211
  obj.$jspbMessageInstance = msg;
244
212
  }
245
-
246
213
  return obj;
247
214
  };
248
215
  }
216
+
249
217
  /**
250
218
  * Deserializes binary data (in protobuf wire format).
251
219
  * @param {jspb.ByteSource} bytes The bytes to deserialize.
252
220
  * @return {!proto.android.emulation.control.JsepMsg}
253
221
  */
254
-
255
-
256
222
  proto.android.emulation.control.JsepMsg.deserializeBinary = function (bytes) {
257
223
  var reader = new jspb.BinaryReader(bytes);
258
224
  var msg = new proto.android.emulation.control.JsepMsg();
259
225
  return proto.android.emulation.control.JsepMsg.deserializeBinaryFromReader(msg, reader);
260
226
  };
227
+
261
228
  /**
262
229
  * Deserializes binary data (in protobuf wire format) from the
263
230
  * given reader into the given message object.
@@ -265,49 +232,40 @@ proto.android.emulation.control.JsepMsg.deserializeBinary = function (bytes) {
265
232
  * @param {!jspb.BinaryReader} reader The BinaryReader to use.
266
233
  * @return {!proto.android.emulation.control.JsepMsg}
267
234
  */
268
-
269
-
270
235
  proto.android.emulation.control.JsepMsg.deserializeBinaryFromReader = function (msg, reader) {
271
236
  while (reader.nextField()) {
272
237
  if (reader.isEndGroup()) {
273
238
  break;
274
239
  }
275
-
276
240
  var field = reader.getFieldNumber();
277
-
278
241
  switch (field) {
279
242
  case 1:
280
243
  var value = new proto.android.emulation.control.RtcId();
281
244
  reader.readMessage(value, proto.android.emulation.control.RtcId.deserializeBinaryFromReader);
282
245
  msg.setId(value);
283
246
  break;
284
-
285
247
  case 2:
286
- var value =
287
- /** @type {string} */
288
- reader.readString();
248
+ var value = /** @type {string} */reader.readString();
289
249
  msg.setMessage(value);
290
250
  break;
291
-
292
251
  default:
293
252
  reader.skipField();
294
253
  break;
295
254
  }
296
255
  }
297
-
298
256
  return msg;
299
257
  };
258
+
300
259
  /**
301
260
  * Serializes the message to binary data (in protobuf wire format).
302
261
  * @return {!Uint8Array}
303
262
  */
304
-
305
-
306
263
  proto.android.emulation.control.JsepMsg.prototype.serializeBinary = function () {
307
264
  var writer = new jspb.BinaryWriter();
308
265
  proto.android.emulation.control.JsepMsg.serializeBinaryToWriter(this, writer);
309
266
  return writer.getResultBuffer();
310
267
  };
268
+
311
269
  /**
312
270
  * Serializes the given message to binary data (in protobuf wire
313
271
  * format), writing to the given BinaryWriter.
@@ -315,81 +273,66 @@ proto.android.emulation.control.JsepMsg.prototype.serializeBinary = function ()
315
273
  * @param {!jspb.BinaryWriter} writer
316
274
  * @suppress {unusedLocalVariables} f is only used for nested messages
317
275
  */
318
-
319
-
320
276
  proto.android.emulation.control.JsepMsg.serializeBinaryToWriter = function (message, writer) {
321
277
  var f = undefined;
322
278
  f = message.getId();
323
-
324
279
  if (f != null) {
325
280
  writer.writeMessage(1, f, proto.android.emulation.control.RtcId.serializeBinaryToWriter);
326
281
  }
327
-
328
282
  f = message.getMessage();
329
-
330
283
  if (f.length > 0) {
331
284
  writer.writeString(2, f);
332
285
  }
333
286
  };
287
+
334
288
  /**
335
289
  * optional RtcId id = 1;
336
290
  * @return {?proto.android.emulation.control.RtcId}
337
291
  */
338
-
339
-
340
292
  proto.android.emulation.control.JsepMsg.prototype.getId = function () {
341
- return (
342
- /** @type{?proto.android.emulation.control.RtcId} */
293
+ return (/** @type{?proto.android.emulation.control.RtcId} */
343
294
  jspb.Message.getWrapperField(this, proto.android.emulation.control.RtcId, 1)
344
295
  );
345
296
  };
297
+
346
298
  /**
347
299
  * @param {?proto.android.emulation.control.RtcId|undefined} value
348
300
  * @return {!proto.android.emulation.control.JsepMsg} returns this
349
301
  */
350
-
351
-
352
302
  proto.android.emulation.control.JsepMsg.prototype.setId = function (value) {
353
303
  return jspb.Message.setWrapperField(this, 1, value);
354
304
  };
305
+
355
306
  /**
356
307
  * Clears the message field making it undefined.
357
308
  * @return {!proto.android.emulation.control.JsepMsg} returns this
358
309
  */
359
-
360
-
361
310
  proto.android.emulation.control.JsepMsg.prototype.clearId = function () {
362
311
  return this.setId(undefined);
363
312
  };
313
+
364
314
  /**
365
315
  * Returns whether this field is set.
366
316
  * @return {boolean}
367
317
  */
368
-
369
-
370
318
  proto.android.emulation.control.JsepMsg.prototype.hasId = function () {
371
319
  return jspb.Message.getField(this, 1) != null;
372
320
  };
321
+
373
322
  /**
374
323
  * optional string message = 2;
375
324
  * @return {string}
376
325
  */
377
-
378
-
379
326
  proto.android.emulation.control.JsepMsg.prototype.getMessage = function () {
380
- return (
381
- /** @type {string} */
382
- jspb.Message.getFieldWithDefault(this, 2, "")
327
+ return (/** @type {string} */jspb.Message.getFieldWithDefault(this, 2, "")
383
328
  );
384
329
  };
330
+
385
331
  /**
386
332
  * @param {string} value
387
333
  * @return {!proto.android.emulation.control.JsepMsg} returns this
388
334
  */
389
-
390
-
391
335
  proto.android.emulation.control.JsepMsg.prototype.setMessage = function (value) {
392
336
  return jspb.Message.setProto3StringField(this, 2, value);
393
337
  };
394
-
395
338
  goog.object.extend(exports, proto.android.emulation.control);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "android-emulator-webrtc",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "Android Emulator WebRTC module",
5
5
  "scripts": {
6
6
  "build": "babel src -d dist",
@@ -16,37 +16,41 @@
16
16
  ]
17
17
  },
18
18
  "jest": {
19
- "verbose": true
19
+ "verbose": true,
20
+ "transformIgnorePatterns": [
21
+ "/node_modules/@juggle/resize-observer/"
22
+ ]
20
23
  },
21
24
  "dependencies": {
22
- "@material-ui/core": "^4.11.3",
23
- "google-protobuf": "^3.14.0",
24
- "grpc-web": "^1.2.1",
25
- "prop-types": "^15.6.0",
26
- "react-resize-observer": "^1.1.1"
25
+ "@react-hook/resize-observer": "^1.2.6",
26
+ "google-protobuf": "^3.21.2",
27
+ "grpc-web": "^1.4.2",
28
+ "prop-types": "^15.8.1"
27
29
  },
28
30
  "peerDependencies": {
29
31
  "react": ">=16.8.0",
30
32
  "react-dom": ">=16.8.0"
31
33
  },
32
34
  "devDependencies": {
33
- "@babel/cli": "^7.12.10",
34
- "@babel/core": "^7.12.10",
35
- "@babel/plugin-proposal-class-properties": "^7.12.1",
36
- "@babel/plugin-transform-runtime": "^7.12.10",
37
- "@babel/preset-env": "^7.12.11",
38
- "@babel/preset-react": "^7.12.10",
39
- "@testing-library/jest-dom": "^5.11.9",
40
- "@testing-library/react": "^11.2.3",
35
+ "@babel/cli": "^7.21.5",
36
+ "@babel/core": "^7.21.8",
37
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
38
+ "@babel/plugin-transform-runtime": "^7.21.4",
39
+ "@babel/preset-env": "^7.21.5",
40
+ "@babel/preset-react": "^7.18.6",
41
+ "@testing-library/jest-dom": "^5.16.5",
42
+ "@testing-library/react": "^14.0.0",
41
43
  "babel-core": "7.0.0-bridge.0",
42
- "babel-jest": "^26.6.3",
43
- "babel-loader": "^8.2.2",
44
+ "babel-jest": "^29.5.0",
45
+ "babel-loader": "^9.1.2",
44
46
  "babel-polyfill": "^6.26.0",
45
- "jest": "^26.6.3",
46
- "react": "^17.0.1",
47
+ "jest": "^29.5.0",
48
+ "jest-environment-jsdom": "^29.5.0",
49
+ "react": "^18.2.0",
47
50
  "react-docgen-markdown-renderer": "^2.1.3",
48
- "react-dom": "^17.0.1",
49
- "yalc": "^1.0.0-pre.50"
51
+ "react-dom": "^18.2.0",
52
+ "resize-observer-polyfill": "^1.5.1",
53
+ "yalc": "^1.0.0-pre.53"
50
54
  },
51
55
  "repository": {
52
56
  "type": "git",
package/proto/README.MD CHANGED
@@ -1,2 +1,2 @@
1
1
  This contains all the protobuf files that are shipped with the emulator.
2
- These were taken at sha 06039669f6
2
+ These were taken at sha b5705ca57ad61b81413aca46d82baf5ceeaeed8c