dailymotion.pugDailymotion video iframes

View source code on Github

Embed videos

mixin dailymotion-video(id, autoplay=false)
  - if (autoplay == true)
    - _autoplay = 1
  - else
    - _autoplay = 0
  - if ("alt" in attributes)
    - alt = attributes.alt;
    - delete attributes.alt;
  - else
    - alt = true;
  iframe(frameborder="0"
         width="480"
         height="270"
         src=`https://www.dailymotion.com/embed/video/${id}?autoPlay=${_autoplay}`
         allowfullscreen="true"
         allow="autoplay")&attributes(attributes)
    - if (alt)
      | Your browser does not support iframes.
+dailymotion-video(id, autoplay=false)(width="480" height="270")

Embed a Dailymotion video.

Arguments:
  • id (string) – Identificator of the video. You can obtain it from their url.
  • autoplay – Indicates if the video is played after loading. As default false.

Usage

Input

+dailymotion-video("x2c3xfh")(width="100%", height="360")

Output

<iframe frameborder="0" width="100%" height="360" src="https://www.dailymotion.com/embed/video/x2c3xfh?autoPlay=0" allowfullscreen="true" allow="autoplay"></iframe>

Render