I'm in a bit of a bind. In my organization, we have recently moved forward with Cisco's Show and Share for our video hosting solution. The problem is that the code Cisco provides to the end user for embedding the video in a third party application employs script tags instead of Embed or Object. Here is a copy of the generated embed code:
<script type="text/javascript" src="https://media.iu5.org/vportal/scripts/videoplayer/DmsEmbedLib.js"></script><script>document.write(dmsEmbed.getSimplePlayer("C-dc282517-ba11-40c9-aa47-2124dd782c29:7","https://media.iu5.org/vportal/VideoPlayer.jsp?ccsid=C-dc282517-ba11-40c9-aa47-2124dd782c29:7#","false",480));</script>
Whenever the code is placed in a label or lesson, the video disappears after the label or lesson is edited and resaved. The code becomes re-written to:
<script src="https://media.myhost.org/vportal/scripts/videoplayer/DmsEmbedLib.js" type="text/javascript"></script>
<script type="text/javascript">// <![CDATA[

document.write(dmsEmbed.getSimplePlayer("C-dc282517-ba11-40c9-aa47-2124dd782c29:7","https://media.myhost.org/vportal/VideoPlayer.jsp?ccsid=C-dc282517-ba11-40c9-aa47-2124dd782c29:7#","false",480));

// ]]></script>
My best guess is that the KSES Filtering is the agent of change here. I couldn't expect my teachers to never have to edit the page, and I can't change the Cisco embed code.
So, how do I either turn off KSES? (Not ideal because it is there for security purposes... or how do I edit KSES to allow this particular code?
Editing or turning off KSES Filtering
Number of replies: 5Re: Editing or turning off KSES Filtering
It might be easier to create a new embedding filter that looks for some "myciscostuff=C-dc282517-ba11-40c9-aa47-2124dd782c29:7" embedded in texts and replaces it with that JS code.
Re: Editing or turning off KSES Filtering
Petr,
I'm very open to creating that new embedding filter - though I have no idea how to go about it. I'm not sure if it is relevant, but I am using TinyMCE for my html editor. So, where can I go to get information on creating the filter that you suggested?
I'm very open to creating that new embedding filter - though I have no idea how to go about it. I'm not sure if it is relevant, but I am using TinyMCE for my html editor. So, where can I go to get information on creating the filter that you suggested?
Re: Editing or turning off KSES Filtering
You could have a look at http://docs.moodle.org/en/Development:Filters and then also have a look at existing filters inside /filter directory.
Saludos. Iñaki.
Re: Editing or turning off KSES Filtering
By the way, that is truly horrible code. document.write. In 2010! I guess Cisco should stick to networks.
Re: Editing or turning off KSES Filtering
It has been nearly a month, and I'm still struggling with this. I have not been able to figure out how to write a filter that will recognize the Cisco text and prevent it from being filtered. I would appreciate any further insight that anyone might be able to lend.
As a side note, I recently made a change that Joseph Rezeau made in the following post: http://moodle.org/mod/forum/discuss.php?d=153907
After changing FORMAT_MOODLE to FORMAT_HTML, on line 540 in mod > lesson > view.php (1.9.9) the Lesson Branch Table no longer gets cleaned! Wonderful! I can now use my Cisco text! It is great that it now works in Lessons, but I need it be able to work in Forum Posts, Labels, etc... I also need the "students" to be able to use the code wherever there is an html area. I assume that this means I'll need a filter, but I'm willing to try anything.
As a side note, I recently made a change that Joseph Rezeau made in the following post: http://moodle.org/mod/forum/discuss.php?d=153907
After changing FORMAT_MOODLE to FORMAT_HTML, on line 540 in mod > lesson > view.php (1.9.9) the Lesson Branch Table no longer gets cleaned! Wonderful! I can now use my Cisco text! It is great that it now works in Lessons, but I need it be able to work in Forum Posts, Labels, etc... I also need the "students" to be able to use the code wherever there is an html area. I assume that this means I'll need a filter, but I'm willing to try anything.