Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84313

webm and ogv cannot be played fully in the app because the range headers are blocked by CORS

XMLWordPrintable

      In the Moodle app, we use the ogvjs library to play ogv and webm videos, like it's done in LMS. This library uses XMLHttpRequest to fetch the video data and render it.

      The video data is retrieved by chunks, so the requests return range headers (e.g. Content-Range: bytes 0-1048575/2144348). These headers are blocked by default when performing a cross-site request, so the Moodle app is only able to fetch and play the first chunk of the video, not the whole video.

      The README of the ogvjs library also specifies that you need to whitelist the Range header for cross-site playback.

      This issue affects the Moodle app but it can also affect any other client trying to play videos served by Moodle from a different domain.

        1. MDL-84313.png
          160 kB
          Ron Carl Alfon Yu
        2. recordrtc_video.webm
          2.05 MB
          Dani Palou

            dpalou Dani Palou
            dpalou Dani Palou
            Juan Leyva Juan Leyva
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 hours, 25 minutes
                7h 25m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.