Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-2677

Moodle Mobile iOS - can't load local files via AJAX because XHR.status returns always 0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.2
    • Fix Version/s: None
    • Component/s: Ionic, iOS
    • Labels:
    • Affected Branches:
      MOODLE_35_STABLE
    • Sprint:
      Moodle Mobile 3.6.0

      Description

      The situation
      In the Moodle mobile app on iOS video captions are not shown. In the browser and in the Moodle desktop app (macOS) the captions are shown.

      Some background
      In a client's WBT videos are handled with MediaElement.js http://www.mediaelementjs.com/. In the videos captions are used. The caption files are loaded via AJAX by the MediaElement library.

      The reason
      Cordova for iOS uses WKWebView to display the content. The Moodle app downloads the content to the device and serves the files locally. Due to iOS CORS restrictions the XHR.status result for local files which are requested via AJAX is always 0 - even if the XHR.responseText holds the correct caption text.

      Ionic WKWebView page
      https://ionicframework.com/docs/wkwebview/

      Support serving local content with WKURLSchemeHandler
      Discussion on https://github.com/apache/cordova-ios/issues/415

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: