phoglund@webrtc.org | f1d6e0a | 2012-06-04 10:06:52 +0000 | [diff] [blame^] | 1 | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 | <!-- |
| 3 | Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 4 | |
| 5 | Use of this source code is governed by a BSD-style license |
| 6 | that can be found in the LICENSE file in the root of the source |
| 7 | tree. An additional intellectual property rights grant can be found |
| 8 | in the file PATENTS. All contributing project authors may |
| 9 | be found in the AUTHORS file in the root of the source tree. |
| 10 | --> |
| 11 | <html> |
| 12 | <head> |
| 13 | <title>Multiple Local Preview (Video Only)</title> |
| 14 | <script type="text/javascript"> |
| 15 | function requestVideo() { |
| 16 | navigator.webkitGetUserMedia({video: true, audio: false}, |
| 17 | getUserMediaOkCallback, |
| 18 | getUserMediaFailedCallback); |
| 19 | } |
| 20 | |
| 21 | function getUserMediaFailedCallback(error) { |
| 22 | alert("User media request denied with error code " + error.code); |
| 23 | } |
| 24 | |
| 25 | function getUserMediaOkCallback(stream) { |
| 26 | var streamUrl = webkitURL.createObjectURL(stream); |
| 27 | for (var i = 1; i <= 10; i++) { |
| 28 | document.getElementById("view" + i).src = streamUrl; |
| 29 | } |
| 30 | } |
| 31 | </script> |
| 32 | </head> |
| 33 | <body onload="requestVideo();"> |
| 34 | <table border="0"> |
| 35 | <tr> |
| 36 | <td>Local Preview</td> |
| 37 | </tr> |
| 38 | <tr> |
| 39 | <td><video width="320" height="240" id="view1" |
| 40 | autoplay="autoplay"></video></td> |
| 41 | <td><video width="320" height="240" id="view2" |
| 42 | autoplay="autoplay"></video></td> |
| 43 | <td><video width="320" height="240" id="view3" |
| 44 | autoplay="autoplay"></video></td> |
| 45 | </tr> |
| 46 | <tr> |
| 47 | <td><video width="320" height="240" id="view4" |
| 48 | autoplay="autoplay"></video></td> |
| 49 | <td><video width="320" height="240" id="view5" |
| 50 | autoplay="autoplay"></video></td> |
| 51 | <td><video width="320" height="240" id="view6" |
| 52 | autoplay="autoplay"></video></td> |
| 53 | </tr> |
| 54 | <tr> |
| 55 | <td><video width="320" height="240" id="view7" |
| 56 | autoplay="autoplay"></video></td> |
| 57 | <td><video width="320" height="240" id="view8" |
| 58 | autoplay="autoplay"></video></td> |
| 59 | <td><video width="320" height="240" id="view9" |
| 60 | autoplay="autoplay"></video></td> |
| 61 | </tr> |
| 62 | <tr> |
| 63 | <td><video width="320" height="240" id="view10" |
| 64 | autoplay="autoplay"></video></td> |
| 65 | </tr> |
| 66 | </table> |
| 67 | </body> |
| 68 | </html> |