Similar to https://github.com/discourse/discourse-chat/pull/1283, this adds the <audio> inline player for uploaded audio files in chat channels.
28 lines
757 B
Handlebars
28 lines
757 B
Handlebars
{{#if (eq this.type this.IMAGE_TYPE)}}
|
|
<img
|
|
class="chat-img-upload"
|
|
data-orig-src={{@upload.short_url}}
|
|
height={{this.size.height}}
|
|
width={{this.size.width}}
|
|
src={{@upload.url}}
|
|
style={{this.imageStyle}}
|
|
loading="lazy"
|
|
{{on "load" this.imageLoaded}}
|
|
/>
|
|
{{else if (eq this.type this.VIDEO_TYPE)}}
|
|
<video class="chat-video-upload" preload="metadata" controls>
|
|
<source src={{@upload.url}} />
|
|
</video>
|
|
{{else if (eq this.type this.AUDIO_TYPE)}}
|
|
<audio class="chat-audio-upload" preload="metadata" controls>
|
|
<source src={{@upload.url}} />
|
|
</audio>
|
|
{{else}}
|
|
<a
|
|
class="chat-other-upload"
|
|
data-orig-href={{@upload.short_url}}
|
|
href={{@upload.url}}
|
|
>
|
|
{{@upload.original_filename}}
|
|
</a>
|
|
{{/if}} |