index.html 868 B

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <style>
  7. body {
  8. margin: unset;
  9. overflow: hidden;
  10. }
  11. video {
  12. width: 100vw;
  13. height: 100vh;
  14. }
  15. </style>
  16. </head>
  17. <body>
  18. <video id="video_source" controls="" autoplay="" name="media">
  19. <source type="video/mp4" />
  20. </video>
  21. <script>
  22. const { invoke, convertFileSrc } = window.__TAURI__.tauri
  23. const video = document.getElementById('video_source')
  24. const source = document.createElement('source')
  25. invoke('video_uri').then(([scheme, path]) => {
  26. source.type = 'video/mp4'
  27. source.src = convertFileSrc(path, scheme)
  28. video.appendChild(source)
  29. video.load()
  30. })
  31. </script>
  32. </body>
  33. </html>