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

Support Vimeo videos restricted by domain in the mobile app

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.2
    • Fix Version/s: 3.4
    • Component/s: Media
    • Labels:
    • Testing Instructions:
      Hide
      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Create a Token in the mobile app service for one user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      3. In a course, create a page resource including this HTML content (you need to replace http://192.168.1.100/m/stable_master/ with your site URL and the token with the one created in the previous step):

        <iframe title="abc" src="http://192.168.1.100/m/stable_master/media/player/vimeo/wsplayer.php?video=235226558&token=12a2a65aeea2a177055e233f9e303218&width=600&height=300" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" width="600" height="300" frameborder="0"></iframe>

      4. Check that you can play and watch the video in the site
      5. Log-in with the user account in the Mobile app and check that you can see the video in the app too
      Show
      As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for one user: Click on Site administration ► Plugins ► Web services ► Manage tokens In a course, create a page resource including this HTML content (you need to replace http://192.168.1.100/m/stable_master/ with your site URL and the token with the one created in the previous step): <iframe title="abc" src="http://192.168.1.100/m/stable_master/media/player/vimeo/wsplayer.php?video=235226558&token=12a2a65aeea2a177055e233f9e303218&width=600&height=300" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" width="600" height="300" frameborder="0"></iframe> Check that you can play and watch the video in the site Log-in with the user account in the Mobile app and check that you can see the video in the app too
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60264-master

      Description

      As reported in MOBILE-1511, Vimeo videos restricted by domain are not working in the app.

      The reason is simple: The restriction is done by the Referer HTTP header, when a video is embedded via an iframe in the Moodle Site, Vimeo checks the Referer to see if it matches the specified domain.

      When the video is embedded in the mobile app, the Referer is the one provided by the app Cordova container so Vimeo won't allow playing the video.

      The solution is to add an extra iframe on top of the Vimeo embedding one (like a proxy), the app will display an iframe pointing to a page in the site that will include the iframe pointing to vimeo so the restriction check will work.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17