This is a migrated thread and some comments may be shown as answers.

Rad Editor Media Manager Problem

1 Answer 71 Views
Editor
This is a migrated thread and some comments may be shown as answers.
dotnetrockerzzz
Top achievements
Rank 2
dotnetrockerzzz asked on 25 Mar 2011, 03:40 PM
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 ..

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 29 Mar 2011, 02:35 PM
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
Tags
Editor
Asked by
dotnetrockerzzz
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Share this question
or