client/settings: add ability to autoplay videos

This commit is contained in:
rr-
2016-11-11 23:14:51 +01:00
parent bf0342df71
commit 81080da06f
6 changed files with 27 additions and 11 deletions

View File

@ -12,16 +12,18 @@
<% } else if (ctx.post.type === 'video') { %>
<% if ((ctx.post.flags || []).includes('loop')) { %>
<video id='video' controls loop='loop'>
<% } else { %>
<video id='video' controls>
<% } %>
<source type='<%- ctx.post.mimeType %>' src='<%- ctx.post.contentUrl %>'/>
Your browser doesn't support HTML5 videos.
</video>
<%= ctx.makeElement(
'video', {
controls: true,
loop: (ctx.post.flags || []).includes('loop'),
autoplay: ctx.autoplay,
},
ctx.makeElement('source', {
type: ctx.post.mimeType,
src: ctx.post.contentUrl,
}),
'Your browser doesn\'t support HTML5 videos.')
%>
<% } else { console.log(new Error('Unknown post type')); } %>