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

@ -61,28 +61,30 @@
<input type="checkbox" class="showmore" id="<%- cwId %>">
<label class="button" for="<%- cwId %>">Show</label>
<% } %>
<div class="item-content">
<%- item.content %>
</div>
<% if (item.enclosures.length > 0){ %>
<div class="enclosures">
<% for (var i = 0; i < item.enclosures.length; i ++){ var e = item.enclosures[i] %>
<a target="_top" class="enclosure" href="<%= e.url %>" >
<% if (e.type.indexOf('image') > -1){ %>
<img src="<%= e.url %>"/>
<% }else if (e.type.indexOf('video') > -1){ %>
<video autoplay loop muted src="<%= e.url %>"/>
<% } else { %>
<%= e.url %>
<% } %>
</a>
<% } %>
</div>
<% } %>
<div class="date"><%= item.stringDate %></div>
<% if (item.enclosures.length > 0){ %>
<div class="enclosures">
<% 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 %>" >
<% if (e.type.indexOf('image') > -1){ %>
<img src="<%= e.url %>"/>
<% } else { %>
<%= e.url %>
<% } %>
</a>
<% } %>
<% } %>
</div>
<% } %>
<div class="date"><%= item.stringDate %></div>
</div>
<% }); %>
<% if (nextPageLink) %>

View File

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

View File

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

View File

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