Skip to content

Commit 01c5d98

Browse files
committed
fix: video-element source format
1 parent 1481b41 commit 01c5d98

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

client/components/video-element.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ class VideoElement extends HTMLElement {
3636
this.classList.add('video')
3737
this.dataset['videoId'] = this.video.id
3838
this.dataset['date'] = this.video.publishedAt
39-
if (this.video.summary) this.dataset['summarized'] = "true"
40-
else this.dataset['summarized'] = "false"
41-
if (this.video.downloaded) this.dataset['downloaded'] = "true"
42-
else this.dataset['downloaded'] = "false"
43-
if (this.video.ignored) this.dataset['ignored'] = "true"
44-
else this.dataset['ignored'] = "false"
39+
this.dataset['summarized'] = this.video.summary ? "true" : "false"
40+
this.dataset['downloaded'] = this.video.downloaded ? "true" : "false"
41+
this.dataset['ignored'] = this.video.ignored ? "true" : "false"
42+
4543
this.innerHTML = /*html*/`
4644
${this.video.downloaded
4745
? /*html*/`<div class="play video-placeholder" style="background-image: url(${this.video.thumbnail})"><div class="play-icon"></div></div>`
@@ -94,7 +92,8 @@ class VideoElement extends HTMLElement {
9492
watchVideoHandler (event) {
9593
event.preventDefault()
9694
this.querySelector('.play.video-placeholder').outerHTML = /*html*/`<video controls width="400">
97-
<source src="/videos/${this.video.id}" type="video/${this.video.format}" />
95+
<source src="/videos/${this.video.id}" type="video/webm" />
96+
<source src="/videos/${this.video.id}" type="video/mp4" />
9897
<track
9998
default
10099
kind="captions"

0 commit comments

Comments
 (0)