ASPxClientCommandConsts.CHANGEYOUTUBEVIDEO_COMMAND Property
In This Article
Identifies a command that changes the selected YouTube video element.
#Declaration
TypeScript
static CHANGEYOUTUBEVIDEO_COMMAND: string
#Property Value
Type | Description |
---|---|
string | Value: “changeyoutubevideo” |
#Remarks
The CHANGEYOUTUBEVIDEO_COMMAND property can be used in the followng ways.
- In the ASPxClientHtmlEditor.CommandExecuted event — to determine the action performed by an end-user. If the ASPxClientHtmlEditorCommandEventArgs.commandName event parameter returns the CHANGEYOUTUBEVIDEO_COMMAND property value, this means that an end-user has clicked the OK button within the Change YouTube Video dialog.
In the ASPxClientHtmlEditor.ExecuteCommand method — to execute the command manually.
In this case, the method requires an additional parameter, which is an object of the ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments type. To create a parameter, use the ASPxClientHtmlEditor.CreateChangeMediaElementCommandArguments method. You can also call the ASPxClientHtmlEditorChangeMediaElementCommandArguments.GetCommandName method of the created parameter to obtain the command name.
// 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);
Note
This command is available only in the Design View.
See Also