OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <!-- | |
4 Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
5 Use of this source code is governed by a BSD-style license that can be | |
6 found in the LICENSE file. | |
7 --> | |
8 <head> | |
9 <title>Media Stream Video Example</title> | |
10 <script type="text/javascript"> | |
11 var plugin; | |
12 var stream; | |
13 | |
14 function handleMessage(message) { | |
15 console.log(message); | |
16 } | |
17 | |
18 function success(s) { | |
19 stream = s; | |
20 plugin.postMessage({track: stream.getVideoTracks()[0]}); | |
21 } | |
22 | |
23 function initialize() { | |
24 plugin = document.getElementById('plugin'); | |
25 plugin.addEventListener('message', handleMessage, false); | |
26 var constractions = { | |
bbudge
2014/01/10 21:09:29
not a word: constractions
Peng
2014/01/10 21:24:51
Done.
| |
27 "audio": false, | |
28 "video": { | |
29 "mandatory": { | |
30 "minWidth": "1280", | |
31 "minHeight": "720", | |
32 "minFrameRate": "30" | |
33 }, | |
34 "optional": [] | |
35 } | |
36 }; | |
37 navigator.webkitGetUserMedia(constractions, success); | |
38 } | |
39 | |
40 document.addEventListener('DOMContentLoaded', initialize, false); | |
41 </script> | |
42 </head> | |
43 | |
44 <body> | |
45 <embed id="plugin" type="application/x-ppapi-example-media-stream-video" | |
46 width="320" height="240"/> | |
47 </body> | |
48 </html> | |
OLD | NEW |