Skip to main content

ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments Class

Contains settings related to the ASPxClientCommandConsts.CHANGEYOUTUBEVIDEO_COMMAND command parameter.

Declaration

declare class ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments extends ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments

Remarks

When the ASPxClientHtmlEditor.ExecuteCommand method is used to execute the ASPxClientCommandConsts.CHANGEYOUTUBEVIDEO_COMMAND command manually, it requires an additional parameter of the ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments type.

To create an instance of this class, pass the YouTube video element you want to change to the ASPxClientHtmlEditor.CreateChangeMediaElementCommandArguments method. It creates an object containing properties of the passed YouTube video element. Then, you can change the required properties and pass the resulting parameter to the ASPxClientHtmlEditor.ExecuteCommand method.

// Changing the selected YouTube video element's source
var video = htmlEditor.GetSelection().GetSelectedElement();
var args = htmlEditor.CreateChangeMediaElementCommandArguments(video);
args.src = "https://www.youtube.com/watch?v=69qEHlHAj7Y";
htmlEditor.ExecuteCommand(args.GetCommandName(), args);
See Also