aboutsummaryrefslogtreecommitdiff
path: root/lib/xesite_templates/src/lib.rs
diff options
context:
space:
mode:
authorXe Iaso <me@christine.website>2022-11-19 13:40:28 -0500
committerXe Iaso <me@christine.website>2022-11-19 13:40:28 -0500
commit8b2605a965085eed3fa79db166446aa0282df5f8 (patch)
treecd545ea38842484698fb8165a6a9616b924906d8 /lib/xesite_templates/src/lib.rs
parent1e11fc23e5c4449facf9a0f8d84a001b8058b6a1 (diff)
downloadxesite-8b2605a965085eed3fa79db166446aa0282df5f8.tar.xz
xesite-8b2605a965085eed3fa79db166446aa0282df5f8.zip
fix video
Signed-off-by: Xe Iaso <me@christine.website>
Diffstat (limited to 'lib/xesite_templates/src/lib.rs')
-rw-r--r--lib/xesite_templates/src/lib.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/xesite_templates/src/lib.rs b/lib/xesite_templates/src/lib.rs
index 8171a3b..2d38052 100644
--- a/lib/xesite_templates/src/lib.rs
+++ b/lib/xesite_templates/src/lib.rs
@@ -101,11 +101,13 @@ pub fn video(path: String) -> Markup {
"https://cdn.xeiaso.net/file/christine-static/{}/index.m3u8",
path
);
+ let uuid = uuid::Uuid::new_v4();
+ let uuid = format!("{uuid}").replace("-", "");
let hls_script = PreEscaped(format!(
r#"
<script>
if (Hls.isSupported()) {{
- let video = document.getElementById('video');
+ let video = document.getElementById('{uuid}');
let hls = new Hls();
let videoSrc = "{}";
hls.on(Hls.Events.MEDIA_ATTACHED, function () {{
@@ -134,7 +136,7 @@ pub fn video(path: String) -> Markup {
(conv("Mara".into(), "hacker".into(), PreEscaped("You may need to enable JavaScript for this to work. I'm a cartoon shark, not a cop.".to_string())))
}
}
- video id="video" width="100%" controls {
+ video id=(uuid) width="100%" controls {
source src=(stream_url) r#type="application/vnd.apple.mpegurl";
source src="https://cdn.xeiaso.net/file/christine-static/blog/HLSBROKE.mp4" r#type="video/mp4";
}