Skip to content

Commit

Permalink
Update stream template (fixes #175)
Browse files Browse the repository at this point in the history
  • Loading branch information
twobiers committed Apr 4, 2024
1 parent 7cd83fb commit 883a477
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions assets/template/streamItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,38 @@
<div class="item-image-thumb" style="background-image: url({item.thumb})"></div>
<?js if(supportsAutoplay) {?>
<video class="item-image-actual" draggable="true" loop autoplay preload="auto">
<?js if (item.variants && item.variants.length > 0) { ?>
<?js for (const variant of item.variants) { ?>
<source src="{variant.src}" type="{{variant.mimeType}}" <?js if (variant.media) { ?> media="{{variant.media}}"
<?js } ?> >
<?js } ?>
<?js } else {?>
<source src="{item.image}" type="video/mp4">
<?js } ?>
<?js if (item.subtitles && item.subtitles.length > 0) { ?>
<?js for (const st of item.subtitles) { ?>
<track kind="subtitles" src="{st.path}" label="{st.label}" srclang="{st.language}" <?js if (st.isDefault) { ?>
data-is-default=""
<?js } ?> >
<track kind="subtitles" src="{st.path}" label="{st.label}" srclang="{st.language}" <?js if (st.isDefault ||
item.subtitles.length===1) { ?> data-is-default=""
<?js } ?> >
<?js } ?>
<?js } ?>
</video>
<?js } else { ?>
<video class="item-image-actual" draggable="true" webkit-playsinline playsinline loop preload="metadata"
poster="{item.thumb}">
<?js if (item.variants && item.variants.length > 0) { ?>
<?js for (const variant of item.variants) { ?>
<source src="{variant.src}" type="{{variant.mimeType}}" <?js if (variant.media) { ?> media="{{variant.media}}"
<?js } ?> >
<?js } ?>
<?js } else {?>
<source src="{item.image}" type="video/mp4">
<?js } ?>
<?js if (item.subtitles && item.subtitles.length > 0) { ?>
<?js for (const st of item.subtitles) { ?>
<track kind="subtitles" src="{st.path}" label="{st.label}" srclang="{st.language}" <?js if (st.isDefault) { ?>
data-is-default=""
<?js } ?> >
<track kind="subtitles" src="{st.path}" label="{st.label}" srclang="{st.language}" <?js if (st.isDefault ||
item.subtitles.length===1) { ?> data-is-default=""
<?js } ?> >
<?js } ?>
<?js } ?>
</video>
Expand Down

0 comments on commit 883a477

Please sign in to comment.