summaryrefslogtreecommitdiff
path: root/avmedia/source/inc/mediamisc.hxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-04-05 11:50:44 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-04-05 14:34:51 +0200
commita5225ba82e94a549f44420f56a7cb9d7906561cc (patch)
tree084be80b91028e3bfbe8cd5e3b50ba97fa8b516d /avmedia/source/inc/mediamisc.hxx
parent8b4af1eb0549b6832361da85ddaa1e13be34ec76 (diff)
avmedia,*: guess the mime type of media files based on file name
.. at least for the most popular types, and do it automatically in MediaItem::setURL(). This should work in practice in most cases and is much simpler than adding some type detection or calling into platform dependent avmedia backends. Remove the parameter that was only ever set to "application/vnd.sun.star.media" anyway, the same value that would be used if it's missing. Stop using that silly type for everything, only use it when guessing fails. In case an ODF document is loaded, it will use the mime type loaded from the file (see setting of MediaMimeType in SdXMLPluginShapeContext) and not guess it because that would require updating the entry in manifest.xml as well. Change-Id: I8ce29cf7425678ae11dda1d8c875be818f8623af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150049 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'avmedia/source/inc/mediamisc.hxx')
-rw-r--r--avmedia/source/inc/mediamisc.hxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx
index 061a7177f05a..f45f5b50da0b 100644
--- a/avmedia/source/inc/mediamisc.hxx
+++ b/avmedia/source/inc/mediamisc.hxx
@@ -19,6 +19,8 @@
#pragma once
+#include <comphelper/mediamimetype.hxx>
+
#include <unotools/resmgr.hxx>
#ifdef _WIN32
@@ -31,9 +33,6 @@
#endif
#endif
-// Mime types
-inline constexpr OUStringLiteral AVMEDIA_MIMETYPE_COMMON = u"application/vnd.sun.star.media";
-
inline OUString AvmResId(TranslateId aId)
{
return Translate::get(aId, Translate::Create("avmedia"));