How to use gatsby-remark-embed-video - 1 common examples

To help you get started, we’ve selected a few gatsby-remark-embed-video examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kyma-project / website / src / components / shared / ReactMarkdown / components / EmbedVideo / helpers.ts View on Github external
export function embedVideoHTML(
  type: string,
  id: string,
  options: IEmbedVideoOptions,
): string {
  try {
    const videoId: IVideoId = readVideoId(type, id);

    const videoService = getVideoService(videoId.service);
    const url = createUrl(videoId.id, videoService, options);
    return createIframe(url, videoService, options);
  } catch (e) {
    return `<p style="color: red">Error: ${e.message}</p>`;
  }
}

gatsby-remark-embed-video

Embed Videos (Youtube, Vimeo, VideoPress) in Gatsby via Markdown

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis

Popular gatsby-remark-embed-video functions