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

Support Vimeo videos restricted by domain in the mobile app

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.4
    • 3.3.2
    • Media
    • MOODLE_33_STABLE
    • MOODLE_34_STABLE
    • MDL-60264-master
    • 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

      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.

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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