Class: media_video

media_video


new media_video()

Video widget control. See WP_Widget_Video::enqueue_admin_scripts() for amending prototype from PHP exports.
Source:

Extends

Members


events :Object

View events.
Type:
  • Object
Inherited From:
Source:

id_base :string

Widget ID base. This may be defined by the subclass. It may be exported from PHP to JS such as is done in WP_Widget_Media_Image::enqueue_admin_scripts(). If not, it will attempt to be discovered by looking to see if this control instance extends each member of component.controlConstructors, and if it does extend one, will use the key as the id_base.
Type:
  • string
Inherited From:
Source:

l10n :Object

Translation strings. The mapping of translation strings is handled by media widget subclasses, exported from PHP to JS such as is done in WP_Widget_Media_Image::enqueue_admin_scripts().
Type:
  • Object
Inherited From:
Source:

mime_type :string

Mime type. This must be defined by the subclass. It may be exported from PHP to JS such as is done in WP_Widget_Media_Image::enqueue_admin_scripts().
Type:
  • string
Inherited From:
Source:

oembedResponses :Object

Cache of oembed responses.
Type:
  • Object
Source:

showDisplaySettings :boolean

Show display settings.
Type:
  • boolean
Overrides:
Source:

Methods


editMedia()

Open the media image-edit frame to modify the selected item.
Overrides:
Source:
Returns:
Type
void

fetchEmbed()

Fetches embed data for external videos.
Source:
Returns:
Type
void

getModelPropsFromMediaFrame(mediaFrame)

Get the instance props from the media selection frame.
Parameters:
Name Type Description
mediaFrame wp.media.view.MediaFrame.Select Select frame.
Inherited From:
Source:
Returns:
Props.
Type
Object

handleMediaLibraryLinkClick(event)

Handle click on link to Media Library to open modal, such as the link that appears when in the missing attachment error notice.
Parameters:
Name Type Description
event jQuery.Event Event.
Inherited From:
Source:
Returns:
Type
void

isHostedVideo()

Whether a url is a supported external host.
Deprecated:
  • since 4.9.
Source:
Returns:
Whether url is a supported video host.
Type
boolean

isSelected()

Whether a media item is selected.
Inherited From:
Source:
Returns:
Whether selected and no error.
Type
boolean

mapMediaToModelProps(mediaFrameProps)

Map media frame props to model props.
Parameters:
Name Type Description
mediaFrameProps Object Media frame props.
Inherited From:
Source:
Returns:
Model props.
Type
Object

mapModelToMediaFrameProps(modelProps)

Map model props to media frame props.
Parameters:
Name Type Description
modelProps Object Model props.
Overrides:
Source:
Returns:
Media frame props.
Type
Object

mapModelToPreviewTemplateProps()

Map model props to previewTemplateProps.
Inherited From:
Source:
Returns:
Preview Template Props.
Type
Object

render()

Render template.
Inherited From:
Source:
Returns:
Type
void

renderPreview()

Render preview.
Overrides:
Source:
Returns:
Type
void

selectMedia()

Open the media select frame to chose an item.
Inherited From:
Source:
Returns:
Type
void

syncModelToInputs()

Sync the model attributes to the hidden inputs, and update previewTemplateProps.
Inherited From:
Source:
Returns:
Type
void

syncModelToPreviewProps()

Sync the model attributes to the hidden inputs, and update previewTemplateProps.
Inherited From:
Source:
Returns:
Type
void

template()

Get template.
Inherited From:
Source:
Returns:
Template.
Type
function

updateSelectedAttachment()

Update the selected attachment if necessary.
Inherited From:
Source:
Returns:
Type
void