While testing Forma 2.0 I encountered this problem: when course admin is trying to embed video from youtube in the html page, the resulting video is shown in editor but after saving it disappeares.
When I try to do the same as system SuperAdmin - I have no problem.
Am I missing something or is it a bug?
video embedding
Re: video embedding
Hi,
it is very strange, but it's true.... I opened a bug in our bugtracker, we'll try to fix this issue for one of the next releases.
it is very strange, but it's true.... I opened a bug in our bugtracker, we'll try to fix this issue for one of the next releases.
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
Re: video embedding
thanks
Re: video embedding
if there will be a quick fix for this issue in the code, please let me know.
Re: video embedding
Using Forma 2.1
I want to add an audio file to a test question - "multiple choice" or "title". By means of the editor, I upload the audio file and add it to the "Question" field. Everything is in order so far (the code <audio src="../files/common/users/11837_63_1552142627_pd-1.mp3" controls="controls"></audio> is visible in code view). When I save the question, this disappears, just as it is reported here for embedded video files. Apparently, the editor field is stripped off such codes probably because of security reasons - or, at least this is what people in various forums for different CMSs report. The solution might lie in TinyMCE itself.
I want to add an audio file to a test question - "multiple choice" or "title". By means of the editor, I upload the audio file and add it to the "Question" field. Everything is in order so far (the code <audio src="../files/common/users/11837_63_1552142627_pd-1.mp3" controls="controls"></audio> is visible in code view). When I save the question, this disappears, just as it is reported here for embedded video files. Apparently, the editor field is stripped off such codes probably because of security reasons - or, at least this is what people in various forums for different CMSs report. The solution might lie in TinyMCE itself.
Re: video embedding
Per supporto GRATUITO contattatemi in privato qui
Re: video embedding
I would like to thank alfa24 for the quick and useful response.
For those who might be as bad as I am in coding, the thing to do is:
(1) locate addons/tiny_mce in your FormaLMS installation,
(2) find the file titled "forma.js",
(3) open the file with a text editor and add this line to, for example, line 25, so that you will not break any code:
valid_elements : '*[*]',
(4) save the file.
You will be able to add multimedia elements into your questions.
For those who might be as bad as I am in coding, the thing to do is:
(1) locate addons/tiny_mce in your FormaLMS installation,
(2) find the file titled "forma.js",
(3) open the file with a text editor and add this line to, for example, line 25, so that you will not break any code:
valid_elements : '*[*]',
(4) save the file.
You will be able to add multimedia elements into your questions.
Re: video embedding
Thank you hakangur and thank you alfa24 for your contributions.
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
Re: video embedding
Found a fix. Works for Forma 2.1:hryhorash wrote: ↑Mon Sep 10, 2018 2:22 pm While testing Forma 2.0 I encountered this problem: when course admin is trying to embed video from youtube in the html page, the resulting video is shown in editor but after saving it disappeares.
When I try to do the same as system SuperAdmin - I have no problem.
Am I missing something or is it a bug?
1. You need to open file /lib/lib.filterinput.php
2. Add the following code
Code: Select all
$config->set('HTML.SafeIframe', true);
$config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vimeo
$config->set('HTML.AllowedElements', array('iframe'));// <-- IMPORTANT
$config->set('HTML.AllowedAttributes','iframe@src,iframe@allowfullscreen');
Code: Select all
$config = HTMLPurifier_Config::createDefault();
Code: Select all
protected function loadTool()
It will allow iframe ONLY from Youtube & Vimeo. Will not allow fullscreen though
- Attachments
-
- lib.filterinput.zip
- (2.76 KiB) Downloaded 504 times
Re: video embedding
After updating to FORMA 2.2.1 my video embedding problems restarted.
By default it is possible to insert youtube video only under superadmin.
Previously described fix is also not working:
- it allows iframe
- the iframe is empty after saving
Is there a solution?
Thanks
By default it is possible to insert youtube video only under superadmin.
Previously described fix is also not working:
- it allows iframe
- the iframe is empty after saving
Is there a solution?
Thanks