Moodle APP + Vimeo privacy setting

Re: Moodle APP + Vimeo privacy setting

by Sergio Renato Aldana Alvarez -
Number of replies: 16
Any solution?
In reply to Sergio Renato Aldana Alvarez

Re: Moodle APP + Vimeo privacy setting

by Tony G -
From my test, Vimeo in iframe can playback in App but URL doesn't.
In reply to Tony G

Re: Moodle APP + Vimeo privacy setting

by Tim Snellings -

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

In reply to Tim Snellings

Re: Moodle APP + Vimeo privacy setting

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi 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 smile

Cheers,
Dani
In reply to Dani Palou

Re: Moodle APP + Vimeo privacy setting

by Kristian Ringer -
Picture of Plugin developers
Hi 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.
In reply to Kristian Ringer

Re: Moodle APP + Vimeo privacy setting

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi Kristian,

We used to suggest using X-Frame-Options "ALLOW-FROM *", but someone from the community told me that it didn't work for him:

"It turned out that’s not the 100% correct syntax and some Firefox started to behave badly (didn’t display iFrames from the Kaltura SaaS plugin any more). The solution was to use the more correct and common X-Frame-Options "ALLOWALL"."

So we changed the docs to use that value. I've been searching and I found some people saying "is no longer a valid option", so maybe it was valid some time ago but now it isn't. And I guess it works because, since it's not a valid value, the default behaviour is to accept the connection.

I'll raise this within the team to decide which is the suggested value to use. 

Cheers,
Dani
In reply to Kristian Ringer

Re: Moodle APP + Vimeo privacy setting

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

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

In reply to Dani Palou

Re: Moodle APP + Vimeo privacy setting

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Sorry, I put "enable" when I meant "disable", I edited my post smile
In reply to Dani Palou

Re: Moodle APP + Vimeo privacy setting

by Kristian Ringer -
Picture of Plugin developers
Hi 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).

Embedding does work in a mod_label activity with direct embed code but not when using the mod_url activity. So I don't think any of these server settings are relevant since we can get the video to embed.

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!
In reply to Kristian Ringer

Re: Moodle APP + Vimeo privacy setting

by Kristian Ringer -
Picture of Plugin developers
I'm starting to think the problem is with this regex: https://github.com/moodlehq/moodleapp/blob/main/src/core/directives/format-text.ts#L806

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:




In reply to Kristian Ringer

Re: Moodle APP + Vimeo privacy setting

by Kristian Ringer -
Picture of Plugin developers
Looks like we should have the mod_url url format like https:// vimeo.com/813446759/656886ae31 but that still doesn't let it work in the app.. even though the iframe src has the hash in a query param now which is the same as the mod_label
In reply to Kristian Ringer

Re: Moodle APP + Vimeo privacy setting

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

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

In reply to Dani Palou

Re: Moodle APP + Vimeo privacy setting

by Kristian Ringer -
Picture of Plugin developers
Thanks 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.
In reply to Kristian Ringer

Re: Moodle APP + Vimeo privacy setting

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi Kristian,

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.

In any case, we'll try to fix the issue I mentioned in my previous post for the next version of the app, with that change the video should work without any changes in the LMS (like it does when using a label or a mod_page).

Cheers,
Dani
In reply to Dani Palou

Re: Moodle APP + Vimeo privacy setting

by Kristian Ringer -
Picture of Plugin developers
The space I added was just for this forum because I didn't want it to embed here. There is no space in the actual activity
In reply to Kristian Ringer

Re: Moodle APP + Vimeo privacy setting

by Eva Corcuera -
I am using Moodle 4.1 and this problem persists. Has any solution been found?
Thanks