cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "W. Matthew Wilson (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-8103) file method on local file returns mime type "video/3gpp" for .mp4 files
Date Sat, 29 Nov 2014 15:45:12 GMT

     [ https://issues.apache.org/jira/browse/CB-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

W. Matthew Wilson updated CB-8103:
----------------------------------
    Description: 
I have a feature in my app where a user can pick a video from their gallery and then upload
it to a remote server.

I need the mime type of the file because right now, I can only process .mp4 files, not .3gp
files.

I'm using something like this code:
{{
    window.resolveLocalFileSystemURL(
        local_video_path, // something like "/media/external/video/media/971"
        function (f) {
            console.debug("inside resolveLocalFileSystemURL callback", f);

            f.file(function (fo) {
                console.debug("fo", fo);

                if (fo.size > 30 * 1000 * 1000) {
                    navigator.notification.alert("Sorry, that file is too big!  Pick one less
than 30 mb.");

                } else if (fo.type == "video/3gpp") {
                    navigator.notification.alert("Sorry, that file is a .3gp file and we can't
handle those!");
                } else {
                    // handle file...
                }
            });
}}


  was:
I have a feature in my app where a user can pick a video from their gallery and then upload
it to a remote server.

I need the mime type of the file because right now, I can only process .mp4 files, not .3gp
files.

I'm using something like this code:
{quote}
    window.resolveLocalFileSystemURL(
        local_video_path, // something like "/media/external/video/media/971"
        function (f) {
            console.debug("inside resolveLocalFileSystemURL callback", f);

            f.file(function (fo) {
                console.debug("fo", fo);

                if (fo.size > 30 * 1000 * 1000) {
                    navigator.notification.alert("Sorry, that file is too big!  Pick one less
than 30 mb.");

                } else if (fo.type == "video/3gpp") {
                    navigator.notification.alert("Sorry, that file is a .3gp file and we can't
handle those!");
                } else {
                    // handle file...
                }
            });

{quote}


> file method on local file returns mime type "video/3gpp" for .mp4 files
> -----------------------------------------------------------------------
>
>                 Key: CB-8103
>                 URL: https://issues.apache.org/jira/browse/CB-8103
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin File
>    Affects Versions: 3.6.3
>            Reporter: W. Matthew Wilson
>
> I have a feature in my app where a user can pick a video from their gallery and then
upload it to a remote server.
> I need the mime type of the file because right now, I can only process .mp4 files, not
.3gp files.
> I'm using something like this code:
> {{
>     window.resolveLocalFileSystemURL(
>         local_video_path, // something like "/media/external/video/media/971"
>         function (f) {
>             console.debug("inside resolveLocalFileSystemURL callback", f);
>             f.file(function (fo) {
>                 console.debug("fo", fo);
>                 if (fo.size > 30 * 1000 * 1000) {
>                     navigator.notification.alert("Sorry, that file is too big!  Pick
one less than 30 mb.");
>                 } else if (fo.type == "video/3gpp") {
>                     navigator.notification.alert("Sorry, that file is a .3gp file and
we can't handle those!");
>                 } else {
>                     // handle file...
>                 }
>             });
> }}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message