I've recently launched our Moodle V4 LMS. The app connects to our site but our Vimeo Videos do not play in the app. They play great on Moodle on a PC. I've got the "Hide from Vimeo" setting in Vimeo as well as show only on specific domains. I've added my domains and even moodle.org but can't get the videos to play in the Moodle app. For some reason, a YouTube video will play on the app. Any assistance/suggestions would be appreciated. Thanks, Tim
as said above, have you verified that the Moodle setting "allowframembedding" is enabled? Also, please make sure your server (Apache o whatever) doesn't force X-Frame-Options to 'sameorigin'. The server should be configured like this:
X-Frame-Options "ALLOWALL"
If your configuration is correct but the videos still don't work please let me know
Cheers,
Dani
Thanks for helping with this.
That option "ALLOWALL", is that special for Moodle? It's not listed as an option for X-Frame-Options https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
Will try forcing that header and let you know, we're not passing down X-Frame-Options at all at the moment.
We used to suggest using X-Frame-Options "ALLOW-FROM *", but someone from the community told me that it didn't work for him:
Ok, we've been reviewing this and we've updated the Moodle app FAQs.
In Moodle 3.7 and higher it's no longer needed to enable the Moodle setting "Allow frame embedding" to make Vimeo videos work in the Moodle app, because it no longer applies to requests coming from the app.
You just need to be sure that your server does NOT set the X-Frame-Options header. If you want it to be set to "sameorigin" then you should just enable disable the "Allow frame embedding setting in Moodle instead.
Cheers,
Dani
I'm working with Tim Snellings above to try to get vimeo embedding in the moodle mobile app (on the public ios app store).
We have no privacy or domain restrictions on videos and embedding works fine in the browser. Youtube embeds in the app as well but Vimeo doesn't and we get a blank screen. We are using the mod_url activity with a basic https:// vimeo.com/813446759 url and display set to embed.
I've tried with/without the x-frame-options header, have removed it now.
Have enabled the vimeo media player and turned on/off allowframeembedding.
We have a very basic moodle site with almost no plugins and default settings so I'm not sure why this wouldn't work.
Do you know how the app works, is it using a normal iframe embedding method in the mod_url page?
I wonder if you have a test moodle site where you can try embedding that video above in mod_url, does it work in the app for you?
Super grateful for any more tips you can give us!
The moodle mod_url activity doesn't include params when creating the embed iframe.
Not working (in app), mod_url:
Working, mod_label direct embed code with url params:
Hi,
thank you for providing more info! I've confirmed this doesn't work properly when using mod_url, I've opened an issue to fix it in the app. In the meantime you'll need to use a workaround like using a label, or a Page with the video.
Cheers,
Dani
I found that mod_url needs to have the URL saved in the format
https:// player.vimeo.com/video/813446759
Then it works in the app!
It's not do with privacy settings (works without the hash too), just to do with the form of the URL.
Now it's not being parsed properly in Moodle by the media player in media/player/vimeo/classes/plugin.php
I think the app is probably fine and the fix should be to let the media_vimeo_plugin change the output like it does in embed_external(). The app external function uses mod_url::url_export_contents which just displays the saved URL. Otherwise the app should do similar work that the media_vimeo_plugin does, convert the stored URL to player.vimeo.. form.
hmm that's weird, maybe adding a space makes the app consider it invalid and then it uses the app's protocol instead of the one in the URL. It's just a guess though, we don't have any private Vimeo video to test this so I have to test it with public videos. In any case it looks like a "workaround" rather than a solution.
In the past, Vimeo's private videos didn't work because the app used the file protocol "file://...", but now we use "http://localhost" in Android and "moodleappfs://localhost" in IOS. Do you have "localhost" as one of the allowed URLs for the private video? If you don't and it works, maybe Vimeo automatically allows playing the video in localhost environments.
Thanks