+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / WMV player - integration with JW Player

WMV player - integration with JW Player

10 posts, 0 answered
  1. Petr
    Petr avatar
    34 posts
    Registered:
    03 Jan 2011
    27 Jun 2011
    Link to this post
    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
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Jun 2011
    Link to this post
    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
  3. Petr
    Petr avatar
    34 posts
    Registered:
    03 Jan 2011
    04 Jul 2011
    Link to this post
    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
  4. Petr
    Petr avatar
    34 posts
    Registered:
    03 Jan 2011
    04 Jul 2011
    Link to this post
    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
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    04 Jul 2011
    Link to this post
    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
  6. Petr
    Petr avatar
    34 posts
    Registered:
    03 Jan 2011
    04 Jul 2011
    Link to this post
    Hi,

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

    Thanks

    Petr
  7. Petr
    Petr avatar
    34 posts
    Registered:
    03 Jan 2011
    04 Jul 2011
    Link to this post
    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
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    04 Jul 2011
    Link to this post
    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
  9. Petr
    Petr avatar
    34 posts
    Registered:
    03 Jan 2011
    04 Jul 2011
    Link to this post
    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
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    04 Jul 2011
    Link to this post
    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
Register for webinar
10 posts, 0 answered