Apache Cordova
  1. Apache Cordova
  2. CB-837

CaptureCB - mediaFile.fullPath does not resolve to file

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.7.0
    • Fix Version/s: None
    • Component/s: Plugin Media
    • Labels:
    • Environment:

      Tested on iOS

      Description

      Hey there,

      Simply put here is an example

      navigator.device.capture.captureAudio(successCB, error,

      {limit: 1}

      );

      function successCB(mediaFile)

      { window.resolveLocalFileSystemURI(mediaFile[0].fullPath, gotFileEntry, fsFail); }

      function fsFail(error)

      { alert('we failed with code ' + error.code); //5 }

      The issue is mediaFile[0].fullPath lacks file://localhost being prepended. Is this intentional?

      Simple work around is just to add it in using

      var path = mediaFile[0].fullPath

      if(path.indexOf("file://localhost") == -1) path = "file://localhost" + path;

        Activity

        Dimitri Adamou created issue -
        Dimitri Adamou made changes -
        Field Original Value New Value
        Description Hey there,

        Simply put here is an example

        navigator.device.capture.captureAudio(successCB, error, {limit: 1});

        function successCB(mediaFile) {
           
           window.resolveLocalFileSystemURI(mediaFile[0].fullPath, gotFileEntry, fsFail);

        }

        function fsFail(error) {
           alert('we failed with code ' + error.code); //5
        }

        The issue is mediaFile[0].fullPath lacks file://localhost being appended. Is this intentional?

        Simple work around is just to add it in using

        var path = mediaFile[0].fullPath

        if(path.indexOf("file://localhost") == -1) path
        Hey there,

        Simply put here is an example

        navigator.device.capture.captureAudio(successCB, error, {limit: 1});

        function successCB(mediaFile) {
           
           window.resolveLocalFileSystemURI(mediaFile[0].fullPath, gotFileEntry, fsFail);

        }

        function fsFail(error) {
           alert('we failed with code ' + error.code); //5
        }

        The issue is mediaFile[0].fullPath lacks file://localhost being prepended. Is this intentional?

        Simple work around is just to add it in using

        var path = mediaFile[0].fullPath

        if(path.indexOf("file://localhost") == -1) path
        Dimitri Adamou made changes -
        Description Hey there,

        Simply put here is an example

        navigator.device.capture.captureAudio(successCB, error, {limit: 1});

        function successCB(mediaFile) {
           
           window.resolveLocalFileSystemURI(mediaFile[0].fullPath, gotFileEntry, fsFail);

        }

        function fsFail(error) {
           alert('we failed with code ' + error.code); //5
        }

        The issue is mediaFile[0].fullPath lacks file://localhost being prepended. Is this intentional?

        Simple work around is just to add it in using

        var path = mediaFile[0].fullPath

        if(path.indexOf("file://localhost") == -1) path
        Hey there,

        Simply put here is an example

        navigator.device.capture.captureAudio(successCB, error, {limit: 1});

        function successCB(mediaFile) {
           
           window.resolveLocalFileSystemURI(mediaFile[0].fullPath, gotFileEntry, fsFail);

        }

        function fsFail(error) {
           alert('we failed with code ' + error.code); //5
        }

        The issue is mediaFile[0].fullPath lacks file://localhost being prepended. Is this intentional?

        Simple work around is just to add it in using

        var path = mediaFile[0].fullPath

        if(path.indexOf("file://localhost") == -1) path = "file://localhost" + path;
        Filip Maj made changes -
        Labels audit
        Filip Maj made changes -
        Component/s Plugin Media [ 12320647 ]
        Component/s CordovaJS [ 12317202 ]
        Jesse MacFadyen made changes -
        Assignee Filip Maj [ filmaj ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Dimitri Adamou
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:

              Development