Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Designing with Sitefinity > WMV player - integration with JW Player

WMV player - integration with JW Player

  • Petr avatar

    Posted on Jun 27, 2011 (permalink)

    Hi,

    please, can you let me know how to integrate JW player into RadEditor? I have to use original JW Player, not your compomentn, because I need to play WMV files. But, the code is using javascript and I'm not able to put JS code via RadEditor - it's automatically deleted via pasteHTML method (but scripts are enabled via appropraite property of RadEditor).

    Have you got any ideas? 

    Thanks

    Petr

    Reply

  • Radoslav Georgiev Radoslav Georgiev admin's avatar

    Posted on Jun 29, 2011 (permalink)

    Hello Petr,

    In order to use JavaScript in RadEditor you should disable the content filter that removes the scripts (RemoveScripts). More information here. I have a sample project which uses JWPlayer in a user control and displays items from the Sitefinity libraries. The project is attached.

    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Attached files

    Reply

  • Petr avatar

    Posted on Jul 4, 2011 (permalink)

    Hi,

    thanks, but I don't need to insert file via control, but via button (action) in RadEditor. So, I'm using pasteHML method and (if I disable all filters in RadEditor) I'm not able to insert this code:

    code="<div name='mediaspace' id='mediaspace' style='background-image: url(/sitefinity/admin/controltemplates/generic_content/player.jpg); width: 441px; height: 235px;'></div><script type='text/javascript'>var cnt = document.getElementById('mediaspace');var src = '/sitefinity/wmvplayer.xaml';var cfg = {file: '"+url+"' ,image: '',height: '240',width: '440'};var ply = new jeroenwijering.Player(cnt, src, cfg);<\/script>";

    Any ideas?

    Thanks

    Petr

    Reply

  • Petr avatar

    Posted on Jul 4, 2011 (permalink)

    Hi,

    thanks, but I don't need to insert file via control, but via button (action) in RadEditor. So, I'm using pasteHML method and (if I disable all filters in RadEditor) I'm not able to insert this code with "script" string in HTML.

    Any ideas?

    Thanks

    Petr

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jul 4, 2011 (permalink)

    Hi Petr,

    I am not able to replicate this issue using the code below

    <asp:ScriptManager runat="server" ID="ScriptManager1" />
       <div>
        
       <script type="text/javascript">
           Telerik.Web.UI.Editor.CommandList["Custom1"] = function(commandName, editor, args) {
           alert("Custom command 1");
           editor.set_html("add your script here")
           };
       </script>
        
       <telerik:RadEditor runat="server" ID="RadEditor1" ContentFilters="ConvertFontToSpan" >
         <Tools>
           <telerik:EditorToolGroup>
               <telerik:EditorTool Name="Custom1" />
               </telerik:EditorToolGroup>
         </Tools>
       </telerik:RadEditor>

    I noticed that the script does not get inserted if it is not a valid.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Petr avatar

    Posted on Jul 4, 2011 (permalink)

    Hi,

    thanks. I'm using pasteHtml method instead of set_html. Is this problem?
    Code is valid, of course.

    Thanks

    Petr

    Reply

  • Petr avatar

    Posted on Jul 4, 2011 (permalink)

    Ivan,

    I've found out, that problem is with pasteHtml method. If I use set_html as in your example, it works - but the problem is, that previous content of editor is lost.

    So, I can't use pasteHtml for inserting scripts?

    Thanks

    Petr

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jul 4, 2011 (permalink)

    Hi Petr,

    It is possible that this is some specific to the RadEditor and the pasteHtml method, so you can create a post in the RadEditot team forum and they will be able to provide you with more specifics about pasteHtml and how it works.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Petr avatar

    Posted on Jul 4, 2011 (permalink)

    Hi,

    thanks. In the meantime, is there some workaround, e.g using set_html, which works?

    Unfortunately, I need to solve it - it's critical for our project.

    Thanks

    Petr

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jul 4, 2011 (permalink)

    Hi Petr,

    You can try using a combination of several methods like get_text(); and set_html();

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Designing with Sitefinity > WMV player - integration with JW Player