0
0
Fork 0

Add download button to audio and video players (#12179)

* Add download button for audio player

* Add download button for video player

* fix padding for download button in Audio component
This commit is contained in:
Nima Boscarino 2019-10-25 02:48:20 -07:00 committed by Eugen Rochko
parent 91945aa78a
commit 9b36f62df6
4 changed files with 24 additions and 0 deletions

View file

@ -12,6 +12,7 @@ const messages = defineMessages({
pause: { id: 'video.pause', defaultMessage: 'Pause' },
mute: { id: 'video.mute', defaultMessage: 'Mute sound' },
unmute: { id: 'video.unmute', defaultMessage: 'Unmute sound' },
download: { id: 'video.download', defaultMessage: 'Download file' },
});
export default @injectIntl
@ -218,6 +219,14 @@ class Audio extends React.PureComponent {
<span className='video-player__time-total'>{formatTime(this.state.duration || Math.floor(this.props.duration))}</span>
</span>
</div>
<div className='video-player__buttons right'>
<button type='button' aria-label={intl.formatMessage(messages.download)}>
<a className='video-player__download__icon' href={this.props.src} download>
<Icon id={'download'} fixedWidth />
</a>
</button>
</div>
</div>
</div>
</div>