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.
If we let videojs auto-init the video/audio tags present in the page - we cannot guarantee that the
youtube library will be loaded by the time video.js is processing the tag.
Video.js uses the presence of a data-setup attibute to signal that it should auto-init this tag, so
we have to rename our config attribute to something else.
This partially reverts changes from MDL-57187 that added the limit for all videos and not just videojs.
Videojs displays a big play button that overlaps contents below during video loading.
The videojs javascript is over 1MB of javascript which we don't need to
load on every page, now that we only require it demand, the js can be
lazily loaded when its needed, which keeps the first.js smaller and more
likely to stay in browser cache.
Previous commits were overlooked, they should have passed the
system context to filter_manager::setup_page_for_fitlers(), the
page context was passed instead. Regardless, the processing of
the latter is too excessive for what we need, but, more importantly,
it does not return "Off, but available" filters which we also need.