Page tree
Skip to end of metadata
Go to start of metadata

Video extends Element

The API model used to edit videos.

Methods


replace(html)

  • html <String> The HTML String to replace.

Replaces the element itself with the HTML String passed as an argument.

var video = editor.getAPIModelById('id');
video.replace('<span>Video replaced</span>');

remove()

Removes the Element itself.

IF ALL ELEMENTS ARE REMOVED, ERRORS MAY OCCUR IN SUBSEQUENT OPERATIONS.

var video = editor.getAPIModelById('id');
video.remove();

setSrc(url)

  • url <String> The URL to set in the video src.

Set the src attribute of the video to the url passed as an argument.

var video = editor.getAPIModelById('id');
video.setSrc('https://youtu.be/Mp3uS3nDyyI');

setWidth(value[, unit = 'px']);

  • value <Number> Width of video
  • unit <String> Unit of width ('px', '%'). default 'px'.

Sets the width of the video.

var video = editor.getAPIModelById('id');
video.setWidth(200);
video.setWidth(100, '%');

setHeight(value[, unit = 'px']);

  • value <Number> Height of video
  • unit <String> Unit of height ('px', '%'). default 'px'.

Sets the height of the video.

var video = editor.getAPIModelById('id');
video.setHeight(200);
video.setHeight(100, 'px');
  • No labels