video_test.html 763 B

123456789101112131415161718192021222324252627
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>视频播放测试</title>
  5. </head>
  6. <body>
  7. <h1>视频播放测试</h1>
  8. <video width="640" height="480" controls>
  9. <source src="http://localhost:8080/videos/20251010_160000/test_stream1.mp4" type="video/mp4">
  10. 您的浏览器不支持视频播放。
  11. </video>
  12. <script>
  13. const video = document.querySelector('video');
  14. video.addEventListener('error', (e) => {
  15. console.log('视频加载错误:', e);
  16. });
  17. video.addEventListener('loadstart', () => {
  18. console.log('开始加载视频');
  19. });
  20. video.addEventListener('canplay', () => {
  21. console.log('视频可以播放');
  22. });
  23. </script>
  24. </body>
  25. </html>