Saurabh Patil
Saurabh Patil

Reputation: 1

Issue Embedding Kaltura Video in Sitecore HTML Editor (Inside Rich Text field)

I’m facing an issue embedding a Kaltura video in a Sitecore rich text field. The video works perfectly in a standalone HTML file, but it doesn’t load when added to Sitecore.

Here’s the code I’m using:

<div id="kaltura_player" style="width: 540px; height: 540px;"></div>
<script src="https://cdnapisec.kaltura.com/embedIframeJs"></script>
<script>
    kWidget.embed({
        "targetId": "kaltura_player",
        "wid": "_xxxxxxx",
        "uiconf_id": xxxxx,
        "flashvars": {},
        "cache_st": xxxxxxxx,
        "entry_id": "xxxxxxx"
    });
</script>

Added the code to the HTML editor in the rich text field.

Confirmed that scripts are not being blocked.

Used a raw HTML field instead of the rich text field.

Checked browser console logs (no errors found).

Has anyone successfully embedded Kaltura videos into a Sitecore rich text or HTML field?

Are there specific configurations needed to allow JavaScript execution in these fields?

Would creating a custom rendering or component in Sitecore be a better solution?

Upvotes: 0

Views: 21

Answers (1)

Marek Musielak
Marek Musielak

Reputation: 27142

You should definitely go for a custom component.

Allowing raw html for content authors is never a good option. Why? Cause you have no control on what they add there. They can totally mess the page if the use bad html. And if they inject any malicious code, then it's even worse.

In your case most probably you miss rendering html as raw text, e.g. in MVC

@Html.Raw(model.KalturaVideoString)

so it's rendered as encoded html instead of html tags.

Upvotes: 0

Related Questions