Skip to content

Rule.io SDK


Rule.io SDK / rcml/src / createVideoElement

Function: createVideoElement()

createVideoElement(options): RcmlVideo

Defined in: rcml/src/email/create-rcml-element.ts:484

Build an <rc-video> element — a video thumbnail rendered as an image with a play-button overlay. attrs.src is the thumbnail URL; attrs.button-url is the video destination (clicking the play button sends the recipient there).

Parameters

options

VideoElementOptions

Attribute map. attrs.src (thumbnail) is expected; attrs.button-url supplies the play-button link target.

Returns

RcmlVideo

A typed RcmlVideo node.

Throws

When attrs are unknown or have invalid values.

Example

ts
createVideoElement({
  attrs: {
    src: 'https://cdn.example.com/thumb.png',
    'button-url': 'https://youtu.be/example',
  },
})