Lines Matching refs:remoting
13 var remoting = remoting || {};
16 * @type {remoting.SessionConnector} The connector object, set when a
19 remoting.connector = null;
22 * @type {remoting.ClientSession} The client session object, set once the
25 remoting.clientSession = null;
30 remoting.connectIT2Me = function() {
31 remoting.ensureSessionConnector_();
33 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
34 remoting.connector.connectIT2Me(accessCode);
38 * Update the remoting client layout in response to a resize event.
42 remoting.onResize = function() {
43 if (remoting.clientSession) {
44 remoting.clientSession.onResize();
53 remoting.onVisibilityChanged = function() {
54 if (remoting.clientSession) {
55 remoting.clientSession.pauseVideo(
61 * Disconnect the remoting client.
65 remoting.disconnect = function() {
66 if (!remoting.clientSession) {
69 if (remoting.clientSession.getMode() == remoting.ClientSession.Mode.IT2ME) {
70 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_IT2ME);
72 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME);
74 remoting.clientSession.disconnect(remoting.Error.NONE);
75 remoting.clientSession = null;
83 * @param {remoting.ClientSession.StateEvent} state
87 case remoting.ClientSession.State.CLOSED:
89 if (remoting.clientSession.getMode() ==
90 remoting.ClientSession.Mode.IT2ME) {
91 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_IT2ME);
92 remoting.hangoutSessionEvents.raiseEvent(
93 remoting.hangoutSessionEvents.sessionStateChanged,
94 remoting.ClientSession.State.CLOSED);
96 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME);
100 case remoting.ClientSession.State.FAILED:
101 var error = remoting.clientSession.getError();
104 error = remoting.Error.UNEXPECTED;
113 showConnectError_(remoting.Error.MISSING_PLUGIN);
117 remoting.clientSession.removeEventListener('stateChanged',
119 remoting.clientSession.cleanup();
120 remoting.clientSession = null;
126 * @param {remoting.Error} errorTag The error to be localized and
134 remoting.accessCode = '';
135 var mode = remoting.clientSession ? remoting.clientSession.getMode()
136 : remoting.connector.getConnectionMode();
137 if (mode == remoting.ClientSession.Mode.IT2ME) {
138 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME);
139 remoting.hangoutSessionEvents.raiseEvent(
140 remoting.hangoutSessionEvents.sessionStateChanged,
141 remoting.ClientSession.State.FAILED
144 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME);
166 if (!remoting.clientSession ||
167 remoting.clientSession.getState() !=
168 remoting.ClientSession.State.CONNECTED) {
171 var perfstats = remoting.clientSession.getPerfStats();
172 remoting.stats.update(perfstats);
173 remoting.clientSession.logStatistics(perfstats);
185 remoting.connectMe2Me = function(hostId) {
186 var host = remoting.hostList.getHostForId(hostId);
188 showConnectError_(remoting.Error.HOST_IS_OFFLINE);
192 if (remoting.Host.needsUpdate(host, webappVersion)) {
207 remoting.connectMe2MeHostVersionAcknowledged_(host);
209 remoting.setMode(remoting.AppMode.HOME);
214 remoting.setMode(remoting.AppMode.CLIENT_HOST_NEEDS_UPGRADE);
216 remoting.connectMe2MeHostVersionAcknowledged_(host);
224 * @param {remoting.Host} host The Me2Me host to which to connect.
227 remoting.connectMe2MeHostVersionAcknowledged_ = function(host) {
228 remoting.ensureSessionConnector_();
229 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
239 var thirdPartyTokenFetcher = new remoting.ThirdPartyTokenFetcher(
280 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
284 remoting.pairingRequested = true;
287 remoting.setMode(remoting.AppMode.HOME);
296 remoting.setMode(remoting.AppMode.CLIENT_PIN_PROMPT);
310 remoting.connector.connectMe2Me(host, requestPin, fetchThirdPartyToken,
314 remoting.HostSettings.load(host.hostId, connectMe2MeHostSettingsRetrieved);
317 /** @param {remoting.ClientSession} clientSession */
318 remoting.onConnected = function(clientSession) {
319 remoting.clientSession = clientSession;
320 remoting.clientSession.addEventListener('stateChanged', onClientStateChange_);
323 remoting.setMode(remoting.AppMode.IN_SESSION);
325 remoting.toolbar.center();
326 remoting.toolbar.preview();
328 remoting.clipboard.startSession();
330 remoting.hangoutSessionEvents.raiseEvent(
331 remoting.hangoutSessionEvents.sessionStateChanged,
332 remoting.ClientSession.State.CONNECTED
334 if (remoting.pairingRequested) {
346 remoting.HostSettings.save(remoting.connector.getHostId(), pairingInfo);
347 remoting.connector.updatePairingInfo(clientId, sharedSecret);
353 if (remoting.platformIsMac()) {
355 } else if (remoting.platformIsWindows()) {
357 } else if (remoting.platformIsChromeOS()) {
359 } else if (remoting.platformIsLinux()) {
376 remoting.onExtensionMessage = function(type, data) {
377 if (remoting.clientSession) {
378 return remoting.clientSession.handleExtensionMessage(type, data);
386 remoting.ensureSessionConnector_ = function() {
387 if (!remoting.connector) {
388 remoting.connector = remoting.SessionConnector.factory.createConnector(
390 remoting.onConnected,
391 showConnectError_, remoting.onExtensionMessage);