Skip to content

DiscordVideoAttachment

Extends

  • DiscordMediaLifecycle

Implements

Constructors

new DiscordVideoAttachment()

new DiscordVideoAttachment(): DiscordVideoAttachment

Returns

DiscordVideoAttachment

Inherited from

DiscordMediaLifecycle.constructor

Other

href

The URL to vidoe file

Example

'https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm'

lightTheme

Implementation of

LightTheme.lightTheme


poster

A poster of the video, this is a static image of the video that is used as thumbnail when not yet having played the video

Example

'https://favna.s-ul.eu/On2pqpAq.png'

lifecycle

disconnectedCallback()

disconnectedCallback(): void

Invoked when the component is removed from the document’s DOM.

This callback is the main signal to the element that it may no longer be used. disconnectedCallback() should ensure that nothing is holding a reference to the element (such as event listeners added to nodes external to the element), so that it is free to be garbage collected.

disconnectedCallback() {
super.disconnectedCallback();
window.removeEventListener('keydown', this._handleKeydown);
}

An element may be re-connected after being disconnected.

Returns

void

Inherited from

DiscordMediaLifecycle.disconnectedCallback

updates

firstUpdated()

firstUpdated(changedProperties): void

Invoked when the element is first updated. Implement to perform one time work on the element after update.

firstUpdated() {
this.renderRoot.getElementById('my-text-area').focus();
}

Setting properties inside this method will trigger the element to update again after this update cycle completes.

Parameters

changedProperties: Map<PropertyKey, unknown>

Returns

void

Inherited from

DiscordMediaLifecycle.firstUpdated


shouldUpdate()

shouldUpdate(changedProperties): boolean

Controls whether or not update() should be called when the element requests an update. By default, this method always returns true, but this can be customized to control when to update.

Parameters

changedProperties: Map<PropertyKey, unknown> | PropertyValueMap<any>

Returns

boolean

Inherited from

DiscordMediaLifecycle.shouldUpdate