Home | History | Annotate | Download | only in manual
      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   <meta http-equiv="X-UA-Compatible" content="chrome=1"/>
     15   <!-- Load the polyfill to switch-hit between Chrome and Firefox -->
     16   <script src="adapter.js"></script>
     17   <script type="text/javascript">
     18   function requestVideo() {
     19     // Call into getUserMedia via the polyfill (adapter.js).
     20     getUserMedia({video: true, audio: false},
     21                          getUserMediaOkCallback,
     22                          getUserMediaFailedCallback);
     23   }
     24 
     25   function getUserMediaFailedCallback(error) {
     26     alert("User media request denied with error code " + error.code);
     27   }
     28 
     29   function getUserMediaOkCallback(stream) {
     30     // Call the polyfill wrapper to attach the media stream to this element.
     31     for (var i = 1; i <= 10; i++) {
     32       attachMediaStream(document.getElementById("view" + i), stream);
     33     }
     34   }
     35   </script>
     36 </head>
     37 <body onload="requestVideo();">
     38   <table border="0">
     39     <tr>
     40       <td>Local Preview</td>
     41     </tr>
     42     <tr>
     43       <td><video width="320" height="240" id="view1"
     44           autoplay="autoplay"></video></td>
     45       <td><video width="320" height="240" id="view2"
     46           autoplay="autoplay"></video></td>
     47       <td><video width="320" height="240" id="view3"
     48           autoplay="autoplay"></video></td>
     49     </tr>
     50     <tr>
     51       <td><video width="320" height="240" id="view4"
     52           autoplay="autoplay"></video></td>
     53       <td><video width="320" height="240" id="view5"
     54           autoplay="autoplay"></video></td>
     55       <td><video width="320" height="240" id="view6"
     56           autoplay="autoplay"></video></td>
     57     </tr>
     58     <tr>
     59       <td><video width="320" height="240" id="view7"
     60           autoplay="autoplay"></video></td>
     61       <td><video width="320" height="240" id="view8"
     62           autoplay="autoplay"></video></td>
     63       <td><video width="320" height="240" id="view9"
     64           autoplay="autoplay"></video></td>
     65     </tr>
     66     <tr>
     67       <td><video width="320" height="240" id="view10"
     68           autoplay="autoplay"></video></td>
     69     </tr>
     70   </table>
     71 </body>
     72 </html>
     73