android-emulator-webrtc 1.0.16 → 1.0.18

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,49 +1,47 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.RtcService = exports.EmulatorControllerService = exports.NopAuthenticator = void 0;
9
-
7
+ exports.RtcService = exports.NopAuthenticator = exports.EmulatorControllerService = void 0;
10
8
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
-
12
9
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
-
14
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
-
16
11
  var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
17
-
18
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
-
13
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
20
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
21
-
22
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
16
  var _emulator_controller_grpc_web_pb = require("../proto/emulator_controller_grpc_web_pb");
25
-
26
17
  var _rtc_service_grpc_web_pb = require("../proto/rtc_service_grpc_web_pb");
27
-
28
18
  var _grpcWeb = require("grpc-web");
29
-
30
19
  var _events = require("events");
31
-
32
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
33
-
34
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
35
-
20
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
36
22
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
37
-
38
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
-
40
- var NopAuthenticator = function NopAuthenticator() {
23
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /*
24
+ * Copyright 2019 The Android Open Source Project
25
+ *
26
+ * Licensed under the Apache License, Version 2.0 (the "License")
27
+ * you may not use this file except in compliance with the License.
28
+ * You may obtain a copy of the License at
29
+ *
30
+ * http://www.apache.org/licenses/LICENSE-2.0
31
+ *
32
+ * Unless required by applicable law or agreed to in writing, software
33
+ * distributed under the License is distributed on an "AS IS" BASIS,
34
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35
+ * See the License for the specific language governing permissions and
36
+ * limitations under the License.
37
+ */
38
+ var NopAuthenticator = /*#__PURE__*/(0, _createClass2["default"])(function NopAuthenticator() {
41
39
  (0, _classCallCheck2["default"])(this, NopAuthenticator);
42
40
  (0, _defineProperty2["default"])(this, "authHeader", function () {
43
41
  return {};
44
42
  });
45
43
  (0, _defineProperty2["default"])(this, "unauthorized", function () {});
46
- };
44
+ });
47
45
  /**
48
46
  * A GrcpWebClientBase that inject authentication headers and intercepts
49
47
  * errors. If the errors are 401, the unauthorized method of the authenticator will be invoked.
@@ -52,18 +50,12 @@ var NopAuthenticator = function NopAuthenticator() {
52
50
  * @class EmulatorWebClient
53
51
  * @extends {GrpcWebClientBase}
54
52
  */
55
-
56
-
57
53
  exports.NopAuthenticator = NopAuthenticator;
58
-
59
54
  var EmulatorWebClient = /*#__PURE__*/function (_GrpcWebClientBase) {
60
55
  (0, _inherits2["default"])(EmulatorWebClient, _GrpcWebClientBase);
61
-
62
56
  var _super = _createSuper(EmulatorWebClient);
63
-
64
57
  function EmulatorWebClient(options, auth) {
65
58
  var _thisSuper, _thisSuper2, _this;
66
-
67
59
  (0, _classCallCheck2["default"])(this, EmulatorWebClient);
68
60
  _this = _super.call(this, options);
69
61
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "on", function (name, fn) {
@@ -71,47 +63,39 @@ var EmulatorWebClient = /*#__PURE__*/function (_GrpcWebClientBase) {
71
63
  });
72
64
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "rpcCall", function (method, request, metadata, methodinfo, callback) {
73
65
  var authHeader = _this.auth.authHeader();
74
-
75
66
  var meta = _objectSpread(_objectSpread({}, metadata), authHeader);
76
-
77
67
  var self = (0, _assertThisInitialized2["default"])(_this);
78
68
  return (0, _get2["default"])((_thisSuper = (0, _assertThisInitialized2["default"])(_this), (0, _getPrototypeOf2["default"])(EmulatorWebClient.prototype)), "rpcCall", _thisSuper).call(_thisSuper, method, request, meta, methodinfo, function (err, res) {
79
69
  if (err) {
80
70
  if (err.code === 401) self.auth.unauthorized();
81
71
  if (self.events) self.events.emit("error", err);
82
72
  }
83
-
84
73
  if (callback) callback(err, res);
85
74
  });
86
75
  });
87
76
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "serverStreaming", function (method, request, metadata, methodInfo) {
88
77
  var authHeader = _this.auth.authHeader();
89
-
90
78
  var meta = _objectSpread(_objectSpread({}, metadata), authHeader);
91
-
92
79
  var stream = (0, _get2["default"])((_thisSuper2 = (0, _assertThisInitialized2["default"])(_this), (0, _getPrototypeOf2["default"])(EmulatorWebClient.prototype)), "serverStreaming", _thisSuper2).call(_thisSuper2, method, request, meta, methodInfo);
93
- var self = (0, _assertThisInitialized2["default"])(_this); // Intercept errors.
80
+ var self = (0, _assertThisInitialized2["default"])(_this);
94
81
 
82
+ // Intercept errors.
95
83
  stream.on("error", function (e) {
96
84
  if (e.code === 401) {
97
85
  self.auth.unauthorized();
98
86
  }
99
-
100
87
  self.events.emit("error", e);
101
88
  });
102
89
  return stream;
103
90
  });
104
91
  _this.auth = auth;
105
92
  _this.events = new _events.EventEmitter();
106
-
107
93
  _this.events.on("error", function (e) {
108
94
  console.log("low level gRPC error: " + JSON.stringify(e));
109
95
  });
110
-
111
96
  return _this;
112
97
  }
113
-
114
- return EmulatorWebClient;
98
+ return (0, _createClass2["default"])(EmulatorWebClient);
115
99
  }(_grpcWeb.GrpcWebClientBase);
116
100
  /**
117
101
  * An EmulatorControllerService is an EmulatorControllerClient that inject authentication headers.
@@ -129,13 +113,9 @@ var EmulatorWebClient = /*#__PURE__*/function (_GrpcWebClientBase) {
129
113
  * @class EmulatorControllerService
130
114
  * @extends {EmulatorControllerClient}
131
115
  */
132
-
133
-
134
116
  var EmulatorControllerService = /*#__PURE__*/function (_EmulatorControllerCl) {
135
117
  (0, _inherits2["default"])(EmulatorControllerService, _EmulatorControllerCl);
136
-
137
118
  var _super2 = _createSuper(EmulatorControllerService);
138
-
139
119
  /**
140
120
  *Creates an instance of EmulatorControllerService.
141
121
  * @param {string} uri of the emulator controller endpoint.
@@ -145,7 +125,6 @@ var EmulatorControllerService = /*#__PURE__*/function (_EmulatorControllerCl) {
145
125
  */
146
126
  function EmulatorControllerService(uri, authenticator, onError) {
147
127
  var _this2;
148
-
149
128
  (0, _classCallCheck2["default"])(this, EmulatorControllerService);
150
129
  _this2 = _super2.call(this, uri);
151
130
  if (!authenticator) authenticator = new NopAuthenticator();
@@ -155,8 +134,7 @@ var EmulatorControllerService = /*#__PURE__*/function (_EmulatorControllerCl) {
155
134
  });
156
135
  return _this2;
157
136
  }
158
-
159
- return EmulatorControllerService;
137
+ return (0, _createClass2["default"])(EmulatorControllerService);
160
138
  }(_emulator_controller_grpc_web_pb.EmulatorControllerClient);
161
139
  /**
162
140
  * An RtcService is an RtcClient that inject authentication headers.
@@ -171,15 +149,10 @@ var EmulatorControllerService = /*#__PURE__*/function (_EmulatorControllerCl) {
171
149
  * @class EmulatorControllerService
172
150
  * @extends {RtcClient}
173
151
  */
174
-
175
-
176
152
  exports.EmulatorControllerService = EmulatorControllerService;
177
-
178
153
  var RtcService = /*#__PURE__*/function (_RtcClient) {
179
154
  (0, _inherits2["default"])(RtcService, _RtcClient);
180
-
181
155
  var _super3 = _createSuper(RtcService);
182
-
183
156
  /**
184
157
  *Creates an instance of RtcService.
185
158
  * @param {string} uri of the emulator controller endpoint.
@@ -189,7 +162,6 @@ var RtcService = /*#__PURE__*/function (_RtcClient) {
189
162
  */
190
163
  function RtcService(uri, authenticator, onError) {
191
164
  var _this3;
192
-
193
165
  (0, _classCallCheck2["default"])(this, RtcService);
194
166
  _this3 = _super3.call(this, uri);
195
167
  if (!authenticator) authenticator = new NopAuthenticator();
@@ -199,8 +171,6 @@ var RtcService = /*#__PURE__*/function (_RtcClient) {
199
171
  });
200
172
  return _this3;
201
173
  }
202
-
203
- return RtcService;
174
+ return (0, _createClass2["default"])(RtcService);
204
175
  }(_rtc_service_grpc_web_pb.RtcClient);
205
-
206
176
  exports.RtcService = RtcService;
@@ -5,74 +5,76 @@
5
5
  * @enhanceable
6
6
  * @public
7
7
  */
8
- // GENERATED CODE -- DO NOT EDIT!
8
+
9
+ // Code generated by protoc-gen-grpc-web. DO NOT EDIT.
10
+ // versions:
11
+ // protoc-gen-grpc-web v1.4.2
12
+ // protoc v3.12.4
13
+ // source: rtc_service.proto
9
14
 
10
15
  /* eslint-disable */
11
16
  // @ts-nocheck
17
+
12
18
  var grpc = {};
13
19
  grpc.web = require('grpc-web');
14
-
15
20
  var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
16
-
17
21
  var proto = {};
18
22
  proto.android = {};
19
23
  proto.android.emulation = {};
20
24
  proto.android.emulation.control = require('./rtc_service_pb.js');
25
+
21
26
  /**
22
27
  * @param {string} hostname
23
28
  * @param {?Object} credentials
24
- * @param {?Object} options
29
+ * @param {?grpc.web.ClientOptions} options
25
30
  * @constructor
26
31
  * @struct
27
32
  * @final
28
33
  */
29
-
30
34
  proto.android.emulation.control.RtcClient = function (hostname, credentials, options) {
31
35
  if (!options) options = {};
32
- options['format'] = 'text';
36
+ options.format = 'text';
37
+
33
38
  /**
34
39
  * @private @const {!grpc.web.GrpcWebClientBase} The client
35
40
  */
36
-
37
41
  this.client_ = new grpc.web.GrpcWebClientBase(options);
42
+
38
43
  /**
39
44
  * @private @const {string} The hostname
40
45
  */
41
-
42
- this.hostname_ = hostname;
46
+ this.hostname_ = hostname.replace(/\/+$/, '');
43
47
  };
48
+
44
49
  /**
45
50
  * @param {string} hostname
46
51
  * @param {?Object} credentials
47
- * @param {?Object} options
52
+ * @param {?grpc.web.ClientOptions} options
48
53
  * @constructor
49
54
  * @struct
50
55
  * @final
51
56
  */
52
-
53
-
54
57
  proto.android.emulation.control.RtcPromiseClient = function (hostname, credentials, options) {
55
58
  if (!options) options = {};
56
- options['format'] = 'text';
59
+ options.format = 'text';
60
+
57
61
  /**
58
62
  * @private @const {!grpc.web.GrpcWebClientBase} The client
59
63
  */
60
-
61
64
  this.client_ = new grpc.web.GrpcWebClientBase(options);
65
+
62
66
  /**
63
67
  * @private @const {string} The hostname
64
68
  */
65
-
66
- this.hostname_ = hostname;
69
+ this.hostname_ = hostname.replace(/\/+$/, '');
67
70
  };
71
+
68
72
  /**
69
73
  * @const
70
74
  * @type {!grpc.web.MethodDescriptor<
71
75
  * !proto.google.protobuf.Empty,
72
76
  * !proto.android.emulation.control.RtcId>}
73
77
  */
74
-
75
-
76
78
  var methodDescriptor_Rtc_requestRtcStream = new grpc.web.MethodDescriptor('/android.emulation.control.Rtc/requestRtcStream', grpc.web.MethodType.UNARY, google_protobuf_empty_pb.Empty, proto.android.emulation.control.RtcId,
77
79
  /**
78
80
  * @param {!proto.google.protobuf.Empty} request
@@ -81,56 +83,39 @@ var methodDescriptor_Rtc_requestRtcStream = new grpc.web.MethodDescriptor('/andr
81
83
  function (request) {
82
84
  return request.serializeBinary();
83
85
  }, proto.android.emulation.control.RtcId.deserializeBinary);
84
- /**
85
- * @const
86
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
87
- * !proto.google.protobuf.Empty,
88
- * !proto.android.emulation.control.RtcId>}
89
- */
90
86
 
91
- var methodInfo_Rtc_requestRtcStream = new grpc.web.AbstractClientBase.MethodInfo(proto.android.emulation.control.RtcId,
92
- /**
93
- * @param {!proto.google.protobuf.Empty} request
94
- * @return {!Uint8Array}
95
- */
96
- function (request) {
97
- return request.serializeBinary();
98
- }, proto.android.emulation.control.RtcId.deserializeBinary);
99
87
  /**
100
88
  * @param {!proto.google.protobuf.Empty} request The
101
89
  * request proto
102
90
  * @param {?Object<string, string>} metadata User defined
103
91
  * call metadata
104
- * @param {function(?grpc.web.Error, ?proto.android.emulation.control.RtcId)}
92
+ * @param {function(?grpc.web.RpcError, ?proto.android.emulation.control.RtcId)}
105
93
  * callback The callback function(error, response)
106
94
  * @return {!grpc.web.ClientReadableStream<!proto.android.emulation.control.RtcId>|undefined}
107
95
  * The XHR Node Readable Stream
108
96
  */
109
-
110
97
  proto.android.emulation.control.RtcClient.prototype.requestRtcStream = function (request, metadata, callback) {
111
98
  return this.client_.rpcCall(this.hostname_ + '/android.emulation.control.Rtc/requestRtcStream', request, metadata || {}, methodDescriptor_Rtc_requestRtcStream, callback);
112
99
  };
100
+
113
101
  /**
114
102
  * @param {!proto.google.protobuf.Empty} request The
115
103
  * request proto
116
- * @param {?Object<string, string>} metadata User defined
104
+ * @param {?Object<string, string>=} metadata User defined
117
105
  * call metadata
118
106
  * @return {!Promise<!proto.android.emulation.control.RtcId>}
119
107
  * Promise that resolves to the response
120
108
  */
121
-
122
-
123
109
  proto.android.emulation.control.RtcPromiseClient.prototype.requestRtcStream = function (request, metadata) {
124
110
  return this.client_.unaryCall(this.hostname_ + '/android.emulation.control.Rtc/requestRtcStream', request, metadata || {}, methodDescriptor_Rtc_requestRtcStream);
125
111
  };
112
+
126
113
  /**
127
114
  * @const
128
115
  * @type {!grpc.web.MethodDescriptor<
129
116
  * !proto.android.emulation.control.JsepMsg,
130
117
  * !proto.google.protobuf.Empty>}
131
118
  */
132
-
133
-
134
119
  var methodDescriptor_Rtc_sendJsepMessage = new grpc.web.MethodDescriptor('/android.emulation.control.Rtc/sendJsepMessage', grpc.web.MethodType.UNARY, proto.android.emulation.control.JsepMsg, google_protobuf_empty_pb.Empty,
135
120
  /**
136
121
  * @param {!proto.android.emulation.control.JsepMsg} request
@@ -139,56 +124,39 @@ var methodDescriptor_Rtc_sendJsepMessage = new grpc.web.MethodDescriptor('/andro
139
124
  function (request) {
140
125
  return request.serializeBinary();
141
126
  }, google_protobuf_empty_pb.Empty.deserializeBinary);
142
- /**
143
- * @const
144
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
145
- * !proto.android.emulation.control.JsepMsg,
146
- * !proto.google.protobuf.Empty>}
147
- */
148
127
 
149
- var methodInfo_Rtc_sendJsepMessage = new grpc.web.AbstractClientBase.MethodInfo(google_protobuf_empty_pb.Empty,
150
- /**
151
- * @param {!proto.android.emulation.control.JsepMsg} request
152
- * @return {!Uint8Array}
153
- */
154
- function (request) {
155
- return request.serializeBinary();
156
- }, google_protobuf_empty_pb.Empty.deserializeBinary);
157
128
  /**
158
129
  * @param {!proto.android.emulation.control.JsepMsg} request The
159
130
  * request proto
160
131
  * @param {?Object<string, string>} metadata User defined
161
132
  * call metadata
162
- * @param {function(?grpc.web.Error, ?proto.google.protobuf.Empty)}
133
+ * @param {function(?grpc.web.RpcError, ?proto.google.protobuf.Empty)}
163
134
  * callback The callback function(error, response)
164
135
  * @return {!grpc.web.ClientReadableStream<!proto.google.protobuf.Empty>|undefined}
165
136
  * The XHR Node Readable Stream
166
137
  */
167
-
168
138
  proto.android.emulation.control.RtcClient.prototype.sendJsepMessage = function (request, metadata, callback) {
169
139
  return this.client_.rpcCall(this.hostname_ + '/android.emulation.control.Rtc/sendJsepMessage', request, metadata || {}, methodDescriptor_Rtc_sendJsepMessage, callback);
170
140
  };
141
+
171
142
  /**
172
143
  * @param {!proto.android.emulation.control.JsepMsg} request The
173
144
  * request proto
174
- * @param {?Object<string, string>} metadata User defined
145
+ * @param {?Object<string, string>=} metadata User defined
175
146
  * call metadata
176
147
  * @return {!Promise<!proto.google.protobuf.Empty>}
177
148
  * Promise that resolves to the response
178
149
  */
179
-
180
-
181
150
  proto.android.emulation.control.RtcPromiseClient.prototype.sendJsepMessage = function (request, metadata) {
182
151
  return this.client_.unaryCall(this.hostname_ + '/android.emulation.control.Rtc/sendJsepMessage', request, metadata || {}, methodDescriptor_Rtc_sendJsepMessage);
183
152
  };
153
+
184
154
  /**
185
155
  * @const
186
156
  * @type {!grpc.web.MethodDescriptor<
187
157
  * !proto.android.emulation.control.RtcId,
188
158
  * !proto.android.emulation.control.JsepMsg>}
189
159
  */
190
-
191
-
192
160
  var methodDescriptor_Rtc_receiveJsepMessages = new grpc.web.MethodDescriptor('/android.emulation.control.Rtc/receiveJsepMessages', grpc.web.MethodType.SERVER_STREAMING, proto.android.emulation.control.RtcId, proto.android.emulation.control.JsepMsg,
193
161
  /**
194
162
  * @param {!proto.android.emulation.control.RtcId} request
@@ -197,52 +165,35 @@ var methodDescriptor_Rtc_receiveJsepMessages = new grpc.web.MethodDescriptor('/a
197
165
  function (request) {
198
166
  return request.serializeBinary();
199
167
  }, proto.android.emulation.control.JsepMsg.deserializeBinary);
200
- /**
201
- * @const
202
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
203
- * !proto.android.emulation.control.RtcId,
204
- * !proto.android.emulation.control.JsepMsg>}
205
- */
206
168
 
207
- var methodInfo_Rtc_receiveJsepMessages = new grpc.web.AbstractClientBase.MethodInfo(proto.android.emulation.control.JsepMsg,
208
- /**
209
- * @param {!proto.android.emulation.control.RtcId} request
210
- * @return {!Uint8Array}
211
- */
212
- function (request) {
213
- return request.serializeBinary();
214
- }, proto.android.emulation.control.JsepMsg.deserializeBinary);
215
169
  /**
216
170
  * @param {!proto.android.emulation.control.RtcId} request The request proto
217
- * @param {?Object<string, string>} metadata User defined
171
+ * @param {?Object<string, string>=} metadata User defined
218
172
  * call metadata
219
173
  * @return {!grpc.web.ClientReadableStream<!proto.android.emulation.control.JsepMsg>}
220
174
  * The XHR Node Readable Stream
221
175
  */
222
-
223
176
  proto.android.emulation.control.RtcClient.prototype.receiveJsepMessages = function (request, metadata) {
224
177
  return this.client_.serverStreaming(this.hostname_ + '/android.emulation.control.Rtc/receiveJsepMessages', request, metadata || {}, methodDescriptor_Rtc_receiveJsepMessages);
225
178
  };
179
+
226
180
  /**
227
181
  * @param {!proto.android.emulation.control.RtcId} request The request proto
228
- * @param {?Object<string, string>} metadata User defined
182
+ * @param {?Object<string, string>=} metadata User defined
229
183
  * call metadata
230
184
  * @return {!grpc.web.ClientReadableStream<!proto.android.emulation.control.JsepMsg>}
231
185
  * The XHR Node Readable Stream
232
186
  */
233
-
234
-
235
187
  proto.android.emulation.control.RtcPromiseClient.prototype.receiveJsepMessages = function (request, metadata) {
236
188
  return this.client_.serverStreaming(this.hostname_ + '/android.emulation.control.Rtc/receiveJsepMessages', request, metadata || {}, methodDescriptor_Rtc_receiveJsepMessages);
237
189
  };
190
+
238
191
  /**
239
192
  * @const
240
193
  * @type {!grpc.web.MethodDescriptor<
241
194
  * !proto.android.emulation.control.RtcId,
242
195
  * !proto.android.emulation.control.JsepMsg>}
243
196
  */
244
-
245
-
246
197
  var methodDescriptor_Rtc_receiveJsepMessage = new grpc.web.MethodDescriptor('/android.emulation.control.Rtc/receiveJsepMessage', grpc.web.MethodType.UNARY, proto.android.emulation.control.RtcId, proto.android.emulation.control.JsepMsg,
247
198
  /**
248
199
  * @param {!proto.android.emulation.control.RtcId} request
@@ -251,47 +202,30 @@ var methodDescriptor_Rtc_receiveJsepMessage = new grpc.web.MethodDescriptor('/an
251
202
  function (request) {
252
203
  return request.serializeBinary();
253
204
  }, proto.android.emulation.control.JsepMsg.deserializeBinary);
254
- /**
255
- * @const
256
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
257
- * !proto.android.emulation.control.RtcId,
258
- * !proto.android.emulation.control.JsepMsg>}
259
- */
260
205
 
261
- var methodInfo_Rtc_receiveJsepMessage = new grpc.web.AbstractClientBase.MethodInfo(proto.android.emulation.control.JsepMsg,
262
- /**
263
- * @param {!proto.android.emulation.control.RtcId} request
264
- * @return {!Uint8Array}
265
- */
266
- function (request) {
267
- return request.serializeBinary();
268
- }, proto.android.emulation.control.JsepMsg.deserializeBinary);
269
206
  /**
270
207
  * @param {!proto.android.emulation.control.RtcId} request The
271
208
  * request proto
272
209
  * @param {?Object<string, string>} metadata User defined
273
210
  * call metadata
274
- * @param {function(?grpc.web.Error, ?proto.android.emulation.control.JsepMsg)}
211
+ * @param {function(?grpc.web.RpcError, ?proto.android.emulation.control.JsepMsg)}
275
212
  * callback The callback function(error, response)
276
213
  * @return {!grpc.web.ClientReadableStream<!proto.android.emulation.control.JsepMsg>|undefined}
277
214
  * The XHR Node Readable Stream
278
215
  */
279
-
280
216
  proto.android.emulation.control.RtcClient.prototype.receiveJsepMessage = function (request, metadata, callback) {
281
217
  return this.client_.rpcCall(this.hostname_ + '/android.emulation.control.Rtc/receiveJsepMessage', request, metadata || {}, methodDescriptor_Rtc_receiveJsepMessage, callback);
282
218
  };
219
+
283
220
  /**
284
221
  * @param {!proto.android.emulation.control.RtcId} request The
285
222
  * request proto
286
- * @param {?Object<string, string>} metadata User defined
223
+ * @param {?Object<string, string>=} metadata User defined
287
224
  * call metadata
288
225
  * @return {!Promise<!proto.android.emulation.control.JsepMsg>}
289
226
  * Promise that resolves to the response
290
227
  */
291
-
292
-
293
228
  proto.android.emulation.control.RtcPromiseClient.prototype.receiveJsepMessage = function (request, metadata) {
294
229
  return this.client_.unaryCall(this.hostname_ + '/android.emulation.control.Rtc/receiveJsepMessage', request, metadata || {}, methodDescriptor_Rtc_receiveJsepMessage);
295
230
  };
296
-
297
231
  module.exports = proto.android.emulation.control;