Skip to main content
A newer version of this page is available. .

ASPxClientCommandConsts.INSERTYOUTUBEVIDEO_COMMAND Property

Identifies a command that inserts a new YouTube video.

Declaration

static INSERTYOUTUBEVIDEO_COMMAND: string

Property Value

Type Description
string

Value: “insertyoutubevideo”

Remarks

The INSERTYOUTUBEVIDEO_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 INSERTYOUTUBEVIDEO_COMMAND property value, this means that an end-user has clicked the OK button within the Insert 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 ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments type.

    // Inserting a new YouTube video element instead of the "myDiv" div
    var myDiv = htmlEditor.GetDesignViewDocument().getElementById("myDiv");
    var args = new ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments(htmlEditor, myDiv);
    args.enablePrivacyEnhancedMode = true;
    args.showPlayerControls = true;
    args.showRelatedVideos = false;
    args.showVideoInfo = true;
    args.src = "https://www.youtube.com/watch?v=jEddDJyWlBM";
    htmlEditor.ExecuteCommand(ASPxClientCommandConsts.INSERTYOUTUBEVIDEO_COMMAND, args);
    

Note

This command is available only in the Design View.

See Also