audio-volume.html 885 B

12345678910111213141516171819202122232425262728
  1. <html>
  2. <script>
  3. function load()
  4. {
  5. var url="http://movies.apple.com/movies/us/apple/ipoditunes/2007/touch/ads/apple_ipodtouch_touch_r640-9cie.mov";
  6. var vid = document.getElementById('vid')
  7. vid.src = url;
  8. vid.volume = 0.05;
  9. vid.load();
  10. }
  11. function setVolume(vol)
  12. {
  13. var vid = document.getElementById('vid')
  14. vid.volume = vol;
  15. }
  16. </script>
  17. <body>
  18. <video id=vid controls autoplay>
  19. </video>
  20. <p>TEST: Audio volume should be 0.05 when the movie begins playing.</p>
  21. <input type="button" value="Load movie" onclick="load()">
  22. <br>
  23. <input type="button" value="volume=1.0" onclick="setVolume(1.0)">
  24. <input type="button" value="volume=0.05" onclick="setVolume(0.05)">
  25. </body>
  26. </html?