Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-6393

Make {File|Directory}Entry.toURL() return something useful for developers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • cordova-plugin-file
    • None

    Description

      Relevant mailing list thread

      FileEntry.toURL() and DirectoryEntry.toURL() should return, by default, URLs which are usable by the webview, as src for video, audio and image tags.

      Practically, this means that .toURL() should return the same values as .toNativeURL() currently does: a file URL if possible; a content (Android) or assets-library (iOS) library if that's required, or a cdvfile URL as a last resort.

      .toNativeURL should stick around for a while (with a deprecation notice) since it's been released, and I've advocated its use on various forums. It should have exactly the same semantics as .toURL though.

      We can introduce a .toInternalURL method to format cdvfile URLs for passing over the bridge, since that is the format that the native side of the file plugin expects, and it would be nice to have a single place where that conversion is done.

      Attachments

        Activity

          People

            iclelland Ian Clelland
            iclelland Ian Clelland
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: