This plugin adds a shortcode to your Eleventy project to easily embed Vidyard videos using the Vidyard Player API v4.
Install the plugin from npm:
npm install eleventy-plugin-vidyard --save-dev
script - Include the Vidyard embed script.trueclass - The class attribute for the player image.vidyard-player-embedversion - The Vidyard API version.4type - The player type.inlineAdd it to your Eleventy Config config file:
import eleventyPluginVidyard from 'eleventy-plugin-vidyard';
export default function (eleventyConfig) {
eleventyConfig.addPlugin(eleventyPluginVidyard);
};
const eleventyPluginVidyard = require('eleventy-plugin-vidyard');
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(eleventyPluginVidyard);
};
import eleventyPluginVidyard from 'eleventy-plugin-vidyard';
export default function (eleventyConfig) {
eleventyConfig.addPlugin(eleventyPluginVidyard, {
script: true,
class: 'vidyard-player-embed',
version: 4,
type: 'inline'
});
};
{% vidyard "https://share.vidyard.com/watch/VIDEO_ID" %}
{% vidyard "https://share.vidyard.com/watch/VIDEO_ID", { script: false, class: "custom-class" } %}
Note: Liquid templates don't support passing objects. Pass extra classes as a string instead:
{% vidyard "https://share.vidyard.com/watch/VIDEO_ID" %}
{% vidyard "https://share.vidyard.com/watch/VIDEO_ID" "my-custom-class" %}
You can pass options directly to the shortcode:
{% vidyard "https://share.vidyard.com/watch/VIDEO_ID", {
script: false,
class: 'vidyard-player-embed my-custom-class'
} %}
Vidyard documentation recommends placing the script tag in the head of your page. In that case, disable script rendering in the shortcode:
<head>
<script src="https://play.vidyard.com/embed/v4.js" type="text/javascript" async></script>
</head>
And configure the plugin:
eleventyConfig.addPlugin(eleventyPluginVidyard, {
script: false
});