1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Fixes #6434: Play flac files (#6666)

This commit is contained in:
SFulpius 2022-07-30 14:11:21 +02:00 committed by GitHub
parent 54cc7063ad
commit ab5313e37f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,9 +31,12 @@ export default function(link: Link, options: Options) {
}
if (options.audioPlayerEnabled && resource.mime.indexOf('audio/') === 0) {
// We want to support both audio/x-flac and audio/flac MIME types, but chromium only supports audio/flac
// https://github.com/laurent22/joplin/issues/6434
const escapedAudioMime = escapedMime === 'audio/x-flac' ? 'audio/flac' : escapedMime;
return `
<audio class="media-player media-audio" controls>
<source src="${escapedResourcePath}" type="${escapedMime}">
<source src="${escapedResourcePath}" type="${escapedAudioMime}">
</audio>
`;
}