1

I'm trying to add a video player inside a content page of a lesson on Moodle using Kaltura's JS embed. The embed looks like the following:

<script src="http://cdnapi.kaltura.com/p/"></script>
<div id="kaltura_player_" style="width: 530px; height: 327px;"
itemprop="video" itemscope itemtype="http://schema.org/VideoObject">
<span itemprop="name" content="Letter"></span>
<span itemprop="description" content="A case study."></span>
<span itemprop="duration" content="233"></span>
<span itemprop="thumbnail"
content="http://cdnbakmi.kaltura.com/p"></span>
<span itemprop="width" content="530"></span>
<span itemprop="height" content="327"></span>
</div>
<script>
kWidget.embed({
 "targetId": "kaltura_player_",
 "wid": "_1410652",
 "uiconf_id": 21346902,
 "flashvars": {
   "akamaiHD": {
     "loadingPolicy": "preInitialize",
     "asyncInit": "true"
   },
   "streamerType": "hdnetwork"
 },
 "cache_st": 139585,
 "entry_id": "0_jd9t3gbd"
});
</script>

After saving the above into a content section in a Tiny MCE editor (as HTML), it directed me to a summarized edit page with each content section, where I can see the section with the video player working/playing just fine. However, during the preview of the content page, it only showed broken js code inside an input tag:

<input type="submit" value="// 
 kWidget.embed({
 &quot;targetId&quot;: &quot;kaltura_player_,
 &quot;wid&quot;: &quot;_1410652&quot;,
 &quot;uiconf_id&quot;: 21346902,
 &quot;flashvars&quot;: {
 &quot;akamaiHD&quot;: {
 &quot;loadingPolicy&quot;: &quot;preInitialize&quot;,
 &quot;asyncInit&quot;: &quot;true&quot;},
 &quot;streamerType&quot;: &quot;hdnetwork&quot;},
 &quot;cache_st&quot;: 1395856314,
 &quot;entry_id&quot;: &quot;0_jd9t3gbd&quot;
    });
// ]]>">

With no player displayed on the preview. Afterwards, I went back into edit mode, into the MCE text editor in HTML mode, and found that it has been altered into this:

<p></p>
<div id="kaltura_player_" style="width: 530px; height: 327px;" itemprop="video" itemscope="" itemtype="http://schema.org/VideoObject"></div>
<p>
<script type="text/javascript">// <![CDATA[
kWidget.embed({
 "targetId": "kaltura_player",
 "wid": "_1410652",
 "uiconf_id": 21346902,
 "flashvars": {
   "akamaiHD": {
     "loadingPolicy": "preInitialize",
     "asyncInit": "true"
   },
   "streamerType": "hdnetwork"
 },
 "cache_st": 5856314,
 "entry_id": ""
});
// ]]></script>
</p>

Is this a Moodle issue? Or a Tiny MCE issue? or both? Is there a security config setting that I've missed? Would anyone know which of these components are altering the js code? Any help would be greatly appreciated!

imalvinz
  • 89
  • 4
  • 1
    There is nothing wrong with CDATA blocks. They might even be required, depending on your doctype. What problem are you actually having? – Brad May 12 '14 at 20:20
  • I want to embed a kaltura video player and it doesn't show up. It just shows broken up js code inside an input tag... – imalvinz May 13 '14 at 15:30
  • I don't see an input tag, and I don't see broken code in your output. – Brad May 13 '14 at 15:31
  • Edited. I'm using "broken" lightly. I mean that it's commented out within an input tag as its value. doctype is html5 – imalvinz May 13 '14 at 15:37

0 Answers0