Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Embedding for Youtube videos not working

  • lpwevers
  • lpwevers's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #250507 by lpwevers
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition Version 5.6.3+230130
Own server or LimeSurvey hosting: Own server
Survey theme/template: BootsWatch
==================
When creating questions, we want to embed Youtube videos. So we click on the "Insert a Youtube video" button and past the embed link for the video. After that, the only thing we get is a red "Remove Video" button:


The source code generated looks like this:
<div class="videodetector"><iframe frameborder="0" src=""></iframe><input class="remove-videodetector" type="button" value="Remove video" /></div>

<p>/</p>

Any ideas on how to fix this?

Kind regards,
Louis

Please Log in to join the conversation.

More
1 year 3 months ago #250577 by Matherion
Replied by Matherion on topic Embedding for Youtube videos not working
I thought I'd add some comments here. It's a very weird error - we also run LS3, and that runs without problems (well, apart from not being up-to-date), but this otherwise fresh LS5 installation somehow removes URLs to videos. Once you saved a question, LimeSurvey strips the content of the question to:
Code:
<div class="videodetector"> </div>
 
<p> </p>
 

Does anybody have any idea why LimeSurvey would consider this a good idea?

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 3 months ago - 1 year 3 months ago #250582 by holch
Replied by holch on topic Embedding for Youtube videos not working

Does anybody have any idea why LimeSurvey would consider this a good idea?


Most probably you told Limesurvey to do so, by activating the XSS filter. :-)

Have a look if the XSS filter is on.

If the XSS filter is OFF and this still happens (and you are on the latest version of your Limesurvey branch) please create a bug report.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 1 year 3 months ago by holch.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 3 months ago - 1 year 3 months ago #250583 by Joffm
Replied by Joffm on topic Embedding for Youtube videos not working
Hi,
1. Do not insert only this "src" into the LimeSurvey wizard, but enter the whole embed code from Youtube.
 

2. Do not use the HTML-Editor, but the "Source code editor". The HTML editor sometomes has its own ideas what to add to the code.
 

 

All done in the Cloud version 5.6.38.

To compare:
This is the result of the HTML-editor
 

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 3 months ago by Joffm.

Please Log in to join the conversation.

  • lpwevers
  • lpwevers's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #250605 by lpwevers
Replied by lpwevers on topic Embedding for Youtube videos not working
Hi,

Thanks for all the suggestions. I've now disabled the XSS filter but alas, that didn't seem to do anything in this regard. So using the source editor I pasted the full URL from Youtube; still no luck. But after having done that, I think I found the culprit. We had a pentest on our system and from the recommendations from that I had something like this in my Apache configuration:
Code:
Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; base-uri 'none'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"

After I commented out that line and restarted Apache, I could see the video in the question. To get that to work I indeed had to use the source editor as @Joffm suggested. Using the HTML editor still doesn't work.

Thanks for all the help.
Louis

Please Log in to join the conversation.

More
1 year 6 days ago #253463 by mathieulorenzo
Replied by mathieulorenzo on topic Embedding for Youtube videos not working
Hello,
I am encountering the same issue despite the explanations on the forum. I am on version 5.6.49.I disabled the CSS filters and used the embedded Youtube code in the source editor.
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="315" sandbox="" scrolling="no" src=" www.youtube.com/embed/ xxxvideoIDxxx" title="YouTube video player" width="560"></iframe>

Would anyone have another idea?


 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 days ago - 1 year 6 days ago #253464 by Joffm
Replied by Joffm on topic Embedding for Youtube videos not working
Hi,
I do not see an issue (5.6.40)
But as said before: Use the source code editor, not the WYSIWYG editor

 

 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 6 days ago by Joffm.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose