make videos not autoplay

This commit is contained in:
fenwick67 2019-03-02 13:48:47 -06:00
parent 1a05b0ba75
commit 8805d45eaa
4 changed files with 29 additions and 22 deletions

View File

@ -68,20 +68,22 @@
<% if (item.enclosures.length > 0){ %> <% if (item.enclosures.length > 0){ %>
<div class="enclosures"> <div class="enclosures">
<% for (var i = 0; i < item.enclosures.length; i ++){ var e = item.enclosures[i] %> <% for (var i = 0; i < item.enclosures.length; i ++){ %>
<% var e = item.enclosures[i] %>
<% if (e.type.indexOf('video') > -1){ %>
<video class="enclosure" controls loop src="<%= e.url %>"/>
<% } else { %>
<a target="_top" class="enclosure" href="<%= e.url %>" > <a target="_top" class="enclosure" href="<%= e.url %>" >
<% if (e.type.indexOf('image') > -1){ %> <% if (e.type.indexOf('image') > -1){ %>
<img src="<%= e.url %>"/> <img src="<%= e.url %>"/>
<% }else if (e.type.indexOf('video') > -1){ %>
<video autoplay loop muted src="<%= e.url %>"/>
<% } else { %> <% } else { %>
<%= e.url %> <%= e.url %>
<% } %> <% } %>
</a> </a>
<% } %> <% } %>
<% } %>
</div> </div>
<% } %> <% } %>
<div class="date"><%= item.stringDate %></div> <div class="date"><%= item.stringDate %></div>
</div> </div>
<% }); %> <% }); %>

View File

@ -102,9 +102,11 @@ a * {
width: 50%; width: 50%;
display: inline-block; display: inline-block;
border: none; border: none;
cursor: zoom-in;
max-height: 12rem; } max-height: 12rem; }
a.enclosure {
cursor: zoom-in; }
.enclosure > * { .enclosure > * {
flex: 1 1 auto; flex: 1 1 auto;
width: 100%; width: 100%;

View File

@ -102,9 +102,11 @@ a * {
width: 50%; width: 50%;
display: inline-block; display: inline-block;
border: none; border: none;
cursor: zoom-in;
max-height: 12rem; } max-height: 12rem; }
a.enclosure {
cursor: zoom-in; }
.enclosure > * { .enclosure > * {
flex: 1 1 auto; flex: 1 1 auto;
width: 100%; width: 100%;

View File

@ -125,15 +125,16 @@ a * {
} }
.enclosure{ .enclosure{
display:flex; display:flex;
flex: 1 1 auto; flex: 1 1 auto;
width:50%; width:50%;
display: inline-block; display: inline-block;
border: none; border: none;
cursor: zoom-in;
max-height: 12rem; max-height: 12rem;
} }
a.enclosure{
cursor: zoom-in;
}
.enclosure>*{ .enclosure>*{
flex: 1 1 auto; flex: 1 1 auto;
width:100%; width:100%;