[Glitch-port] Audio player

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-11-18 22:25:13 +01:00
parent b0602f0f86
commit ab503e18f1
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
2 changed files with 37 additions and 0 deletions

View file

@ -176,6 +176,21 @@ class Item extends React.PureComponent {
/>
</a>
);
} else if (attachment.get('type') === 'audio') {
thumbnail = (
<div
className='media-gallery__audio'
aria-label={attachment.get('description')}
role='application'
>
<span><p>sound<br/>only</p></span>
<span><p>{attachment.get('description')}</p></span>
<audio
src={attachment.get('url')}
controls
/>
</div>
);
} else if (attachment.get('type') === 'gifv') {
const autoPlay = !isIOS() && autoPlayGif;

View file

@ -74,6 +74,28 @@
}
}
.media-gallery__audio {
height: 100%;
display: flex;
flex-direction: column;
span {
text-align: center;
color: $darker-text-color;
display: flex;
height: 100%;
align-items: center;
p {
width: 100%;
}
}
audio {
width: 100%;
}
}
.media-gallery {
box-sizing: border-box;
margin-top: 8px;