File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const messages = defineMessages({
1212 pause : { id : 'video.pause' , defaultMessage : 'Pause' } ,
1313 mute : { id : 'video.mute' , defaultMessage : 'Mute sound' } ,
1414 unmute : { id : 'video.unmute' , defaultMessage : 'Unmute sound' } ,
15+ download : { id : 'video.download' , defaultMessage : 'Download file' } ,
1516} ) ;
1617
1718export default @injectIntl
@@ -218,6 +219,14 @@ class Audio extends React.PureComponent {
218219 < span className = 'video-player__time-total' > { formatTime ( this . state . duration || Math . floor ( this . props . duration ) ) } </ span >
219220 </ span >
220221 </ div >
222+
223+ < div className = 'video-player__buttons right' >
224+ < button type = 'button' aria-label = { intl . formatMessage ( messages . download ) } >
225+ < a className = 'video-player__download__icon' href = { this . props . src } download >
226+ < Icon id = { 'download' } fixedWidth />
227+ </ a >
228+ </ button >
229+ </ div >
221230 </ div >
222231 </ div >
223232 </ div >
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const messages = defineMessages({
1919 close : { id : 'video.close' , defaultMessage : 'Close video' } ,
2020 fullscreen : { id : 'video.fullscreen' , defaultMessage : 'Full screen' } ,
2121 exit_fullscreen : { id : 'video.exit_fullscreen' , defaultMessage : 'Exit full screen' } ,
22+ download : { id : 'video.download' , defaultMessage : 'Download file' } ,
2223} ) ;
2324
2425export const formatTime = secondsNum => {
@@ -494,7 +495,13 @@ class Video extends React.PureComponent {
494495 { ( ! onCloseVideo && ! editable ) && < button type = 'button' aria-label = { intl . formatMessage ( messages . hide ) } onClick = { this . toggleReveal } > < Icon id = 'eye-slash' fixedWidth /> </ button > }
495496 { ( ! fullscreen && onOpenVideo ) && < button type = 'button' aria-label = { intl . formatMessage ( messages . expand ) } onClick = { this . handleOpenVideo } > < Icon id = 'expand' fixedWidth /> </ button > }
496497 { onCloseVideo && < button type = 'button' aria-label = { intl . formatMessage ( messages . close ) } onClick = { this . handleCloseVideo } > < Icon id = 'compress' fixedWidth /> </ button > }
498+ < button type = 'button' aria-label = { intl . formatMessage ( messages . download ) } >
499+ < a className = 'video-player__download__icon' href = { this . props . src } download >
500+ < Icon id = { 'download' } fixedWidth />
501+ </ a >
502+ </ button >
497503 < button type = 'button' aria-label = { intl . formatMessage ( fullscreen ? messages . exit_fullscreen : messages . fullscreen ) } onClick = { this . toggleFullscreen } > < Icon id = { fullscreen ? 'compress' : 'arrows-alt' } fixedWidth /> </ button >
504+
498505 </ div >
499506 </ div >
500507 </ div >
Original file line number Diff line number Diff line change 776776 {
777777 "defaultMessage" : " Unmute sound" ,
778778 "id" : " video.unmute"
779+ },
780+ {
781+ "defaultMessage" : " Download file" ,
782+ "id" : " video.download"
779783 }
780784 ],
781785 "path" : " app/javascript/mastodon/features/audio/index.json"
Original file line number Diff line number Diff line change @@ -5330,6 +5330,10 @@ a.status-card.compact:hover {
53305330 display : flex ;
53315331 justify-content : space-between ;
53325332 padding-bottom : 10px ;
5333+
5334+ .video-player__download__icon {
5335+ color : inherit ;
5336+ }
53335337 }
53345338
53355339 & __buttons {
You can’t perform that action at this time.
0 commit comments