Firefox OS/Remote Control

From MozillaWiki
Jump to navigation Jump to search

Introduction

Meta Bug: bug 1205939

Prototype Demo Video: http://bit.ly/1Fa2ST1

UX & Visual Spec

UX Spec: http://bit.ly/1jrWqgn

Visual Spec: http://bit.ly/1jrWQU3

Architecture Designs

Ajax Protocol

Touch Events

 {
   type: 'touchstart',
   detail: {
     width: <touch panel width, integer, in pixels>,
     height: <touch panel height, integer, in pixels>,
     identifier: <A simple unique identifier for server to distinguish touch events between different clients, string>
   }
 }
 {
   type: 'touchmove',
   detail: {
     dx: <dx between current point and starting point, integer, in pixels>,
     dy: <dy between current point and starting point, integer, in pixels>,
     identifier: <should be identical with "touchstart">,
     duration: <duration from "touchstart", integer, in milliseconds>
   }
 }
 {
   type: 'touchend',
   detail: {
     dx: <same as "touchmove">,
     dy: <same as "touchmove">,
     identifier: <should be identical with "touchstart">,
     duration: <same as "touchmove">,
     swipe: <the gesture within this touch, string, should be "left", "right", "up" and "down">
   }
 }

Scroll Events

There are "scrollstart", "scrollmove" and "scrollend" events which details are all identical with corresponding touch events above.

Key Events

 {
   type: 'keypress',
   detail: <KeyEvent constant, string, sush as "DOM_VK_RETURN">
 }

Input Events

 {
   type: 'input',
   detail: {
     clear: <whether to clear the entire string in the current focused input field, boolean>,
     string: <new string to append, string>,
     keycode: <a specified key to be pressed after the string inputted, integer>
   }
 }

Custom Events

 {
   type: 'custom',
   action: <custom action name, string>,
   ...
 }

Pairing

Meta Bug: bug 1207996

Flowchart

First Time Connection

RemoteControl FirstConnect.png

Enter PIN Code

RemoteControl EnterPIN.png

Resume Connection

RemoteControl ResumeConnection.png

Dismiss Pairing

RemoteControl DismissPairing.png

Protocol

from client to server via AJAX

 {
   pincode: <pincode>
 }

response when success

 {
   verified: true,
   uuid: <uuid>
 }

reponse when error

 {
   verified: false,
   reason: 'expired' / 'invalid'
 }

internal events at server side

 {
   type: 'mozChromeRemoteControlEvent',
   detail: {
     action: 'pin-created',
     pincode: <pincode>
   }
 }
 {
   type: 'mozChromeRemoteControlEvent',
   detail: {
     action: 'pin-destroyed'
   }
 }
 {
   type: 'mozContentEvent',
   detail: {
     type: 'remote-control-pin-dismissed',
     detail: {
       reason: 'timeout' / 'manually'
     }
   }
 }

Secure Connection

To protect private data between user and TV, we provide a secure connection which refers to SSL and jCryption. Here is the concept:

  1. Client requests RSA public key from TV.
  2. Client sends symmetric key and PIN code (if any) to TV, encrypted with public key.
  3. TV decrypts symmetric key with private key
  4. TV generates an UUID, encrypts with symmetric key then sends 2 UUIDs to client, one is encrypted the other is not.
  5. Client decrypts UUID with symmetric key, confirm UUID
  6. Begin remote control with symmetric key.

Goal of Remote Control is to create an easy to use way for every device, we hide public key exchange at the background. User doesn't need to input a long URL with public key nor scan QRCode. Everything is done automatically without interrupting user experience.

Remote Security.png

Bug Status

Top blockers of bug 1205939 - [TV][2.5][meta][TV side] Remote Control

Bugzilla query error

Array ( [type] => error [message] => http-bad-status [params] => Array ( [0] => 429 [1] => Unknown Error ) ) 1


Top blockers of bug 1207971 - [TV 2.5][meta] Provide a TV remote control app

Bugzilla query error

Array ( [type] => error [message] => http-bad-status [params] => Array ( [0] => 429 [1] => Unknown Error ) ) 1


Top blockers of bug 1208006 - [TV 2.5][meta] Implement a client-side page for TV remote control

Bugzilla query error

Array ( [type] => error [message] => http-bad-status [params] => Array ( [0] => 429 [1] => Unknown Error ) ) 1


Top blockers of bug 1212385 - [TV 2.5][meta] Remote Control features in Smart System

Bugzilla query error

Array ( [type] => error [message] => http-bad-status [params] => Array ( [0] => 429 [1] => Unknown Error ) ) 1