| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var stream; | 5 var stream; |
| 6 | 6 |
| 7 function success(s) { | 7 function success(s) { |
| 8 stream = s; | 8 stream = s; |
| 9 common.naclModule.postMessage({track: stream.getVideoTracks()[0]}); | 9 common.naclModule.postMessage({ |
| 10 command: 'init', |
| 11 track: stream.getVideoTracks()[0] |
| 12 }); |
| 10 } | 13 } |
| 11 | 14 |
| 12 function failure(e) { | 15 function failure(e) { |
| 13 common.logMessage("Error: " + e); | 16 common.logMessage("Error: " + e); |
| 14 } | 17 } |
| 15 | 18 |
| 16 function moduleDidLoad() { | 19 function moduleDidLoad() { |
| 17 navigator.webkitGetUserMedia({'video': true}, success, failure); | 20 navigator.webkitGetUserMedia({'video': true}, success, failure); |
| 18 } | 21 } |
| 22 |
| 23 function changeFormat(format) { |
| 24 common.naclModule.postMessage({command:'format', format: format}); |
| 25 } |
| 26 |
| 27 function changeSize(width, height) { |
| 28 common.naclModule.postMessage({command:'size', width: width, height: height}); |
| 29 } |
| 30 |
| OLD | NEW |