| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Media</title> | 4 <title>Media</title> |
| 5 <script> | 5 <script> |
| 6 var micCount = 0; | 6 var micCount = 0; |
| 7 var cameraCount = 0; | 7 var cameraCount = 0; |
| 8 var combinedCount = 0; | 8 var combinedCount = 0; |
| 9 function gotMicrophone(stream) { | 9 function gotMicrophone(stream) { |
| 10 micCount++; | 10 micCount++; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 {audio : true}, gotMicrophone, errorCallback); | 27 {audio : true}, gotMicrophone, errorCallback); |
| 28 } | 28 } |
| 29 function initiate_getCamera() { | 29 function initiate_getCamera() { |
| 30 navigator.webkitGetUserMedia( | 30 navigator.webkitGetUserMedia( |
| 31 {video : true}, gotCamera, errorCallback); | 31 {video : true}, gotCamera, errorCallback); |
| 32 } | 32 } |
| 33 function initiate_getCombined() { | 33 function initiate_getCombined() { |
| 34 navigator.webkitGetUserMedia( | 34 navigator.webkitGetUserMedia( |
| 35 {video : true, audio: true}, gotCombined, errorCallback); | 35 {video : true, audio: true}, gotCombined, errorCallback); |
| 36 } | 36 } |
| 37 |
| 38 // The modal permission dialog requires a user gesture to trigger. H
ook up |
| 39 // a click event listener to run a specified method (which may be ch
anged by |
| 40 // the test). |
| 41 var functionToRun = 'initiate_getCombined()'; |
| 42 function runFunctionOnClick() { |
| 43 eval(functionToRun); |
| 44 } |
| 45 |
| 46 window.addEventListener('load', () => { |
| 47 window.addEventListener('click', runFunctionOnClick); |
| 48 }); |
| 37 </script> | 49 </script> |
| 38 </head> | 50 </head> |
| 39 <body> | 51 <body> |
| 40 </body> | 52 </body> |
| 41 </html> | 53 </html> |
| OLD | NEW |