Rad Editor Media Manager Problem

2 posts, 0 answers
  1. dotnetrockerzzz
    dotnetrockerzzz avatar
    32 posts
    Member since:
    Aug 2010

    Posted 25 Mar 2011 Link to this post

    Currently , In my Media manager when someone posts the video the video automatically starts by default  that is when the page loads .  The User who is entering the video has to enter at that time weather it starts automatically or not . What I want is somehow by default the video is not started @ page load.. I hope u r getting my problem ..
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 29 Mar 2011 Link to this post

    Hello Vaibhav,


    You can disable the automatic media playing by adding the <param name='autostart' value='0' /> tag to the inserted media object tag. You can do that by attaching to the OnClientPasteHtml event of RadEditor and modifying the inserted via the Media Manager content:

    Copy Code
    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientPasteHtml="OnClientPasteHtml">
    <MediaManager ViewPaths="~/" UploadPaths="~/" />
    </telerik:RadEditor>
    <script type="text/javascript">
    function OnClientPasteHtml(sender, args)
    {
    var commandName = args.get_commandName();
    var value = args.get_value();
    if (commandName == "MediaManager")
    {
    //See if an img has an alt tag set
    var div = document.createElement("DIV");
    //Do not use div.innerHTML as in IE this would cause the image's src or the link's href to be converted to absolute path.
    //This is a severe IE quirk.
    Telerik.Web.UI.Editor.Utils.setElementInnerHtml(div,value);
    var mediaString = div.innerHTML;
    alert(mediaString);
    mediaString = mediaString.replace("<embed", "<rade_param name='autostart' value='0' /><embed");
    alert(mediaString);
    //Set new content to be pasted into the editor
    args.set_value(mediaString);
    }
    }
    </script>


    Best wishes,
    Rumen
    the Telerik team
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top