Integrating JW Player with Rich Text Editor

Dec 20, 2013


This post will show how videos can be added to a Rich Text field using the Rich Text Editor. Videos can be added from Media Library or a CDN. The width and height of the video can be set while adding the video. Videos are displayed on the website with JWplayer.

The solution is to create a custom button on the Rich Text Editor which, on click, will show a popup to enter video details and add video to content. The following high-level steps illustrate how the solution can be implemented.

Step 1: Create an Editor Button item in the Core database

Create a copy of Rich Text Default toolbar and insert a Html Editor Button.The data source property of the Rich Text field should be set to the newly created profile.
jwplayer_image_1

Step 2: Shell Implementation

Add the corresponding XML file (InsertVideo.xml) to the folder \sitecore\shell\Controls\Rich Text Editor. This file will set the video width and height and call the JavaScript code to pop up the dialog to enter video details.

Step 3: Create a config file that includes the Rich Text commands JavaScript file

This config file is placed in the App_Config\Include folder.

Step 4: Create a JavaScript file to add JWplayer code

Add the references of jQuery and JWplayer to the layout.

Step 5: Add video to content using Rich Text Editor

On clicking the video icon in the Rich Text Editor, it will show a popup where the user can enter details of the video.
jwplayer_image_2

After the data is entered, click the Link button. This will add a Video tag to the content in the Rich Text field.

Step 6: Save and publish the item to render the video on the page

GET HELP FROM OUR EXPERTS

Over the past 17 years, we have completed thousands of digital projects globally. We have one of the largest and deepest multi-solutions digital consulting teams in the world. Our proprietary processes and years of Digital Experience expertise have earned us a 97% customer satisfaction rating with our clients ranging from Global Fortune 1000 to Mid-Market Enterprises, leading educational institutions, and Non-Profits.

For further assistance to Integrating JW Player with Rich Text Editor on Sitecore Contact Us.

ABOUT TECHASPECT

TechAspect is an innovative digital transformation agency, specializing in delivering the digital experience, commerce, and marketing solutions. For nearly two decades, we have been helping traditional businesses transform and create dynamic digital cultures through disruptive strategies and agile deployment of innovative solutions.