mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-23 02:32:28 +03:00
35 lines
868 B
HTML
35 lines
868 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<style>
|
|
body {
|
|
margin: unset;
|
|
overflow: hidden;
|
|
}
|
|
video {
|
|
width: 100vw;
|
|
height: 100vh;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<video id="video_source" controls="" autoplay="" name="media">
|
|
<source type="video/mp4" />
|
|
</video>
|
|
<script>
|
|
const { invoke, convertFileSrc } = window.__TAURI__.tauri
|
|
const video = document.getElementById('video_source')
|
|
const source = document.createElement('source')
|
|
invoke('video_uri').then(([scheme, path]) => {
|
|
source.type = 'video/mp4'
|
|
source.src = convertFileSrc(path, scheme)
|
|
video.appendChild(source)
|
|
video.load()
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|