mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #33933
[Bug 1540654] A change has been merged
Reviewed: https://reviews.mahara.org/6004
Committed: https://git.mahara.org/mahara/mahara/commit/bc07f998667d71347710886e637c07890e2e6e58
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch: master
commit bc07f998667d71347710886e637c07890e2e6e58
Author: Son Nguyen <son.nguyen@xxxxxxxxxxxxxxx>
Date: Thu Feb 4 09:15:44 2016 +1300
Enable OGG media. Bug 1540654
TODO: Currently a DB constraint on our mimetypes table
prevents us from having two file suffixes mapped to the
same mimetype, which means we can either support .ogg
or .oga files, but not both. Since .oga files are already
in our table, I'm going with that for now.
behatnotneeded
Change-Id: Ie364b111f7b4dc956712b179fefca6e76b23d5e9
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1540654
Title:
Proper handling of ".ogg" files
Status in Mahara:
Fix Committed
Bug description:
Son has found that Mahara doesn't currently handle ".ogg" files
correctly. We have separate mappings for ".ogv" and ".oga" in the
artefact_file_mime_types table, representing OGG video and OGG audio.
But we don't have a mapping for ".ogg", which is a fairly common file
extension on the internet, historically used by OGG video and OGG
audio!
So, this gets passed to finfo->file() or mime_content_type(), both of
which identify a ".ogg" as "application/ogg", making it inaccessible
to either the audio player block or the video player block!
This puts us in a bind, because none of our available methods (file
suffix, finfo, or mime_content_type) can determine whether these files
are audio or video. The command-line Unix utility "mimetype" *can*
distinguish them, but it's preferable not to bring more command-line
utility execution into Mahara because it hurts portability.
Fortunately, there's an easy way out. According to Wikipedia, the
".ogg" suffix was used for both OGG video & OGG audio prior to 2007.
After that, the Xiph foundation changed their recommendation so that
".ogg" should be used only for audio files. (See
https://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions for the
up-to-date list).
So, we should fix this issue as follows:
1. As an immediate fix, put a mapping in artefact_file_mime_types
mapping ".ogg" to "ogg/audio".
2. As a longer-term fix, see if there are any all-PHP techniques (or
maybe Javascript techniques we could use at the upgrade step?) to
distinguish ogg/audio and ogg/video files based on their file content.
(i.e., has anyone ported the "mimetype" utility to PHP?)
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1540654/+subscriptions
References