Skip to content

Commit af2fa68

Browse files
committed
(UI) improve audio play
1 parent a48fc1d commit af2fa68

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

src/ChatWindow/Message.vue

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@
130130
</div>
131131

132132
<div v-else-if="message.file.audio" class="audio-message">
133-
<audio controls v-if="message.file.audio">
134-
<source :src="message.file.url" />
135-
</audio>
133+
<div id="player">
134+
<audio controls v-if="message.file.audio">
135+
<source :src="message.file.url" type="audio/mpeg" />
136+
</audio>
137+
</div>
136138
</div>
137139

138140
<div v-else class="file-message">
@@ -721,6 +723,35 @@ export default {
721723
text-align: right;
722724
}
723725
726+
.selector:not(*:root),
727+
#player {
728+
width: 250px;
729+
overflow: hidden;
730+
border-top-right-radius: 1em;
731+
border-bottom-right-radius: 2.5em 1em;
732+
733+
audio {
734+
height: 40px;
735+
736+
&::-webkit-media-controls-panel {
737+
height: 40px;
738+
}
739+
740+
&::-webkit-media-controls-mute-button {
741+
display: none;
742+
}
743+
744+
&::-webkit-media-controls-timeline {
745+
min-width: 103px;
746+
max-width: 142px;
747+
}
748+
749+
&:focus {
750+
outline: none;
751+
}
752+
}
753+
}
754+
724755
.audio-message {
725756
margin-top: 3px;
726757
}

0 commit comments

Comments
 (0)