Skip to content

Commit

Permalink
Merge pull request #7937 from bjester/ensure-correct-audio-type
Browse files Browse the repository at this point in the history
Ensure mp3 type is audio/mpeg in media player
  • Loading branch information
jonboiser committed Apr 1, 2021
2 parents a94c3b1 + d3fc838 commit a2fb851
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<source
:key="audio.storage_url"
:src="audio.storage_url"
:type="`audio/${audio.extension}`"
:type="audioSourceType(audio.extension)"
>
</template>
</audio>
Expand Down Expand Up @@ -154,6 +154,18 @@
trackFileExtensions.some(ext => ext === file.extension)
);
},
audioSourceType() {
return function(extension) {
switch (extension) {
case 'mp3':
// the correct type for mp3
return 'audio/mpeg';
default:
// generally speaking, this should work for others
return `audio/${extension}`;
}
};
},
isVideo() {
return this.videoSources.length;
},
Expand Down

0 comments on commit a2fb851

Please sign in to comment.