iOS playsinline attribute for video tags

Prevent videos from automatically full-screening on autoplay by using
the iOS 10+ playsinline attribute.
This commit is contained in:
Noah Petherbridge 2024-05-19 14:08:17 -07:00
parent 12a1adc270
commit 8ed489c264
6 changed files with 7 additions and 7 deletions

View File

@ -661,7 +661,7 @@
<div class="column is-one-quarter is-clipped">
<!-- GIF video? -->
{{if HasSuffix $Body.Photo.Filename ".mp4"}}
<video loop controls controlsList="nodownload"
<video loop controls controlsList="nodownload" playsinline
{{if $Body.Photo.AltText}}title="{{$Body.Photo.AltText}}"{{end}}
{{if BlurExplicit $Body.Photo}}class="blurred-explicit"
{{else if (not (eq ($Root.CurrentUser.GetProfileField "autoplay_gif") "false"))}}autoplay

View File

@ -213,7 +213,7 @@
{{else}}
<!-- GIF video? -->
{{if HasSuffix .Filename ".mp4"}}
<video autoplay loop controls controlsList="nodownload">
<video autoplay loop controls controlsList="nodownload" playsinline>
<source src="{{PhotoURL .Filename}}" type="video/mp4">
</video>
{{else}}

View File

@ -30,7 +30,7 @@
<div class="image block">
<!-- GIF video? -->
{{if HasSuffix .Photo.Filename ".mp4"}}
<video autoplay loop controls controlsList="nodownload">
<video autoplay loop controls controlsList="nodownload" playsinline>
<source src="{{PhotoURL .Photo.Filename}}" type="video/mp4">
</video>
{{else}}

View File

@ -562,7 +562,7 @@
<div class="card-image has-text-centered is-clipped">
<!-- GIF video? -->
{{if HasSuffix .Filename ".mp4"}}
<video loop controls controlsList="nodownload"
<video loop controls controlsList="nodownload" playsinline
{{if .AltText}}title="{{.AltText}}"{{end}}
{{if BlurExplicit .}}class="blurred-explicit"
{{else if (not (eq ($Root.CurrentUser.GetProfileField "autoplay_gif") "false"))}}autoplay
@ -689,7 +689,7 @@
<div class="card-image has-text-centered is-clipped">
<!-- GIF video? -->
{{if HasSuffix .Filename ".mp4"}}
<video loop controls controlsList="nodownload"
<video loop controls controlsList="nodownload" playsinline
{{if .AltText}}title="{{.AltText}}"{{end}}
{{if BlurExplicit .}}class="blurred-explicit"
{{else if (not (eq ($Root.CurrentUser.GetProfileField "autoplay_gif") "false"))}}autoplay

View File

@ -71,7 +71,7 @@
<div class="card-image has-text-centered is-clipped">
<!-- GIF video? -->
{{if HasSuffix .Photo.Filename ".mp4"}}
<video loop controls controlsList="nodownload"
<video loop controls controlsList="nodownload" playsinline
{{if .Photo.AltText}}title="{{.Photo.AltText}}"{{end}}
{{if BlurExplicit .Photo}}class="blurred-explicit"
{{else if (not (eq ($Root.CurrentUser.GetProfileField "autoplay_gif") "false"))}}autoplay

View File

@ -184,7 +184,7 @@
<div class="card-content">
<figure id="editphoto-preview" class="image block">
{{if HasSuffix .EditPhoto.Filename ".mp4"}}
<video autoplay loop controls controlsList="nodownload">
<video autoplay loop controls controlsList="nodownload" playsinline>
<source src="{{PhotoURL .EditPhoto.Filename}}" type="video/mp4">
</video>
{{else}}