Moodle APP + Vimeo privacy setting

Moodle APP + Vimeo privacy setting

by Marie Autefort -
Number of replies: 34

Good evening everyone,


First, I would like to say that I really like the Moodle app, it's really useful to our students. 

The only problem we have with it right now is that our students are not able to watch our videos Vimeo. The problem is the privacy setting. Indeed, to be sure that only our students can watch the videos, our videos are only available in the domain of our Moodle. It works perfectly in the site but unfortunately, not in the app.


Is there something we can add in the domain name to make it work?


Thank you for your help! Thank you.

Average of ratings: -
In reply to Marie Autefort

Re: Moodle APP + Vimeo privacy setting

by Willy Gomez -

Hi...

I already use vimeo with privacy setting on app and videos work fine.

The settings that I have are:

- Who can See this video: Hide from vimeo.com

- where can I embed this video: I wrote my domain

- Who can Comment this video: Nobody

- What can Others do with this video:  Nothing


I hope it helps you... 

Average of ratings: Useful (1)
In reply to Marie Autefort

Re: Moodle APP + Vimeo privacy setting

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
In reply to Juan Leyva

Re: Moodle APP + Vimeo privacy setting

by Ludo M -
Hello,

I have enabled "Allow frame embedding" (allowframembedding) on my Moodle platform, but I still can't see the video from Vimeo (protected or not) in the app.
Is there something specific to do with the iframe code provided by vimeo?

In reply to Ludo M

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 Ludo,

i guess your Moodle site version is 3.3.4 or higher, right?

As far as I know you don't need to do anything specific to the code to make it work.

Cheers,

Dani

In reply to Dani Palou

Re: Moodle APP + Vimeo privacy setting

by Alcides Magno -

About Moodle Mobile APP,  how can I play Vimeo Videos on my mobile?!

When I create page, it´s show me a blank page

In reply to Ludo M

Re: Moodle APP + Vimeo privacy setting

by Louisa van der Linden -

My vimeo is working on web and Mobile app. Just tested with a normal public vimeo video.
I'm on Moodle 3.5:

  • Allow Frame Embedding is not enabled. My understanding is that this setting is if you want your Moodle site to be embedded into other systems e.g. when using LTI.
  • I just went to Site Administration > Plugins overview > Multi media plugins (must be enabled > click on settings > click on Manage Media Players. then in-line with Vimeo, just enable it. See attached. It then immediately worked.

Attachment Capture.PNG
Average of ratings: Useful (2)
In reply to Louisa van der Linden

Re: Moodle APP + Vimeo privacy setting

by Deron Spencer -

I have the same issue. Vimeo is configured with my domain to only allow my videos to be embedded there. This works fine on my moodle site as the videos show up there but when I use the moodle mobile app they don't. Is it that the moodle app streams the videos via a different domain or something? 

In reply to Deron Spencer

Re: Moodle APP + Vimeo privacy setting

by Thierry Seguin -
Same issue too.
I've juste enable vimeo plugin but but it doesn't help. idem with Allow frame embedding" (allowframembedding) activated that is no useful on App.
Moodle 3.8.2.

(Editado por Dani Palou - envío original martes, 5 de mayo de 2020, 13:17)

In reply to Thierry Seguin

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 Thierry,

I removed your image because it contained a user token and the site URL. Please be careful when sharing that because it can be used to access your site with a certain user.

For all of you that say it doesn't work even with allowframembedding enabled: 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"

Cheers,
Dani
In reply to Dani Palou

Re: Moodle APP + Vimeo privacy setting

by Thierry Seguin -

Thanks. Where can I configure that ? I've asked to my internet host, and he said it's no on his side.


regards,

In reply to Thierry Seguin

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
It depends on the server you're using. If it's Apache, it is usually in the httpd.conf file. For IIS servers I think it's in the Web.config file. I'm not sure about others.

Please notice the exact command also depends on the server. Please see some examples in here:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options#Examples
Average of ratings: Useful (1)
In reply to Dani Palou

Re: Moodle APP + Vimeo privacy setting

by Joel Alvarado -

Thanks to Dani


This worked for me, it's going to be a security issue but if you don't need that kind of security, this works perfectly.

In reply to Marie Autefort

Re: Moodle APP + Vimeo privacy setting

by Sergio Renato Aldana Alvarez -

I have the same problem when I insert a Vimeo video in a forum the screen looks blank, I already tried a YouTube video and this one does.

Moodle 3.6 Allow frame embedding active

In reply to Sergio Renato Aldana Alvarez

Re: Moodle APP + Vimeo privacy setting

by Kevin Quinn -

Has anyone got an answer to this, my Vimeo video shows as blank in the Mobile App too. 

The video plays is password protected and plays fine on my computer.

Followed guidance on this thread but still no joy.

In reply to Marie Autefort

Re: Moodle APP + Vimeo privacy setting

by Sergio Renato Aldana Alvarez -
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
In reply to Marie Autefort

Re: Moodle APP + Vimeo privacy setting

by Stephen Berry -

Hi Everyone, I also had this problem. My way round it was as follows:

Use Willy Gomez's answer and then use the Moodle Mobile App for phones and tablets, this allows the video to play within the course when using a PC or Laptop, then, by using the Moodle App. it plays on phones and tablets.

I then found it played on my mobile when accessing the material using Safari.

I'm using Moodle 3.9.2 (Build: 20200914)

Regards

Steve

Average of ratings: Useful (1)