Back to Devexpress

ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments Class

aspnet-js-aspxclienthtmleditorchangeyoutubevideocommandarguments.md

latest2.3 KB
Original Source

ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments Class

Contains settings related to the ASPxClientCommandConsts.CHANGEYOUTUBEVIDEO_COMMAND command parameter.

Declaration

ts
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.

javascript
// 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);

Inheritance

ASPxClientHtmlEditorCommandArguments ASPxClientHtmlEditorChangeMediaElementCommandArguments ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments

See Also

Client-Side Commands

ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments Members