How to Embed Videos in WordPress

WordPress Plugin

WordPress DynTube Embed is a plugin ( https://github.com/dyntube-com/wordpress-dyntube-embed ) that facilitates the integration of DynTube videos and channels into WordPress sites. It provides functionality for video embedding with customizable options, including user tracking and responsive design.

Features

  • Shortcode implementation for easy embedding of DynTube videos and channels

  • Support for both iframe-based and JavaScript-based embed codes

  • Optional email tracking for user analytics (iframe embeds)

  • Responsive video embedding

  • Customizable video aspect ratios (iframe embeds)

  • Configurable maximum dimensions for both embed types

Download Plugin

You can download the WordPress plugin using this link https://files.dyntube.com/v1/wordpress/wordpress-dyntube-embed.zip

Installation

  1. Access your WordPress dashboard and navigate to Plugins > Add New Plugin > Upload Plugin.

  2. Upload the wordpress-dyntube-embed.zip file. The latest version is available in the dist directory.

  3. Activate the plugin via the 'Plugins' menu in WordPress.

Usage

Shortcode Syntax

Iframe-based Embed (Individual Videos)

[dyntube iframe_id="YOUR_IFRAME_ID" track_email="true" ratio="16x9"]

JavaScript-based Embed (Channels or Videos)

[dyntube channel_key="YOUR_CHANNEL_KEY" track_email="true"]

Parameters

Iframe-based Embed Parameters

Parameter
Required
Description
Default

iframe_id

Yes

DynTube video iframe ID

N/A

track_email

No

Enable/disable email tracking ("true" or "false")

"false"

ratio

No

Video aspect ratio (e.g., "16x9", "4x3", "1x1")

"16x9"

width

No

Maximum video width in pixels

N/A

height

No

Maximum video height in pixels

N/A

JavaScript-based Embed Parameters

Parameter
Required
Description
Default

channel_key

Yes

DynTube channel key or video's channel key

N/A

width

No

Maximum embed width in pixels

N/A

track_email

No

Enable/disable email tracking ("true" or "false")

"false"

Implementation Examples

  1. Default 16:9 ratio iframe embed:

    [dyntube iframe_id="kt0E5TY8ABGTYkl4gf6uFQ"]
  2. Iframe embed with email tracking:

    [dyntube iframe_id="kt0E5TY8ABGTYkl4gf6uFQ" track_email="true"]
  3. Custom 9:16 ratio iframe embed:

    [dyntube iframe_id="kt0E5TY8ABGTYkl4gf6uFQ" ratio="9x16"]
  4. JavaScript-based channel embed:

    [dyntube channel_key="NCzHehj8Z0OKtqNE1TbfA"]
  5. JavaScript-based channel embed with maximum width:

    [dyntube channel_key="NCzHehj8Z0OKtqNE1TbfA" width="800"]

Identifier Retrieval

iframe_id

The iframe_id is the unique identifier for a DynTube video. It can be obtained from:

  • The DynTube dashboard

  • The DynTube API

  • The final segment of the DynTube video iframe URL

Example: For the URL https://videos.dyntube.com/iframes/kt0E5TY8ABGTYkl4gf6uFQ, the iframe_id is kt0E5TY8ABGTYkl4gf6uFQ.

channel_key

The channel_key can be acquired through:

  • The ChannelKey field of a video when fetched using the API

  • Clicking on a video title in the dashboard

  • The Key field of a channel when fetched using the API

  • Clicking the three-dots icon next to the channel name in the dashboard

Other ways to Embed

Please watch the video below to enable you to learn how you can embed DynTube videos in your WordPress website.

Embed a video using a code editor in WordPress

Please watch the video to see how you can embed a video as well as a video channel.

Last updated