Browse Source

support video

master
欧醚 2 years ago
parent
commit
16e4c95a09
1 changed files with 10 additions and 6 deletions
  1. +10
    -6
      static/index.html

+ 10
- 6
static/index.html View File

@ -140,12 +140,12 @@
.comment-list-wrapper {
background: #3333;
padding-left: 7%;
font-size: 80%;
font-size: 90%;
}
.status-media-image {
.status-media {
max-height: 500px;
max-width: 90%;
max-width: 100%;
margin: 10px auto;
}
@ -258,10 +258,14 @@
status.content.replace(/^<p>\[([^\]]*)\]:<br \/>/, '<p>') : status.content}
</div>
${status.media_attachments.map((media) => {
if (media.type === 'image') {
return `<image class="status-media-image" src=${media.url}>`;
switch (media.type) {
case 'image':
return `<image class="status-media" src=${media.url}>`;
case 'video':
return `<video class="status-media" src=${media.url} controls></video>`;
default:
return '';
}
return '';
}).join('\n')}
<div style="text-align:right;margin: 0px 0 -5px">
<time class="timeago" datetime="${status.created_at}"

Loading…
Cancel
Save