TPESystem/Media/MediaSupportFileFormat

< TPESystem‎ | Media
Revision as of 10:18, 19 December 2013 by Blake Wu (talk | contribs) (Created page with "===Media Supported File Format=== Some tips/clues shown below can help you know why the newly-added file is not seen or cannot be played. For videos, usually if the thumbnail...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Media Supported File Format

Some tips/clues shown below can help you know why the newly-added file is not seen or cannot be played. For videos, usually if the thumbnail of a file cannot be generated. It cannot be shown in Gallery or Video APP. Related bugs: bug 942078

  1. File Type Check

Categorize files in 3 groups, pictures, music, and videos @gecko/toolkit/content/devicestorage.properties. You need to check if your file extension is in the following list. Otherwise it will be not recognized as media files.

  • Pictures:

"*.jpe; *.jpg; *.jpeg; *.gif; *.png; *.bmp;"

  • Music:

"*.mp3; *.ogg; *.m4a; *.m4b; *.m4p; *.m4r; *.3gp; *.mp4; *.m3u; *.pls; *.opus; *.amr;"

  • Videos:

"*.mp4; *.mpeg; *.mpg; *.ogv; *.ogx; *.webm; *.3gp; *.ogg; *.m4v;"

  1. MIME Type Get

For Gaia,
Before getting metadata, canPlayType is used to check if it is valid video file by passing MIME type to gecko to check in http://mxr.mozilla.org/gaia/source/apps/video/js/metadata.js#148
For Gecko,
Get MIME type from extension list http://dxr.mozilla.org/mozilla-central/source/uriloader/exthandler/nsExternalHelperAppService.cpp#483
So if your file extension is not in the list. You will get a empty MIME.