diff --git a/_data/media.yml b/_data/media.yml new file mode 100644 index 00000000000..9cd69b4ce95 --- /dev/null +++ b/_data/media.yml @@ -0,0 +1,18 @@ +- extension: mp3 + mime_type: mpeg +- extension: mov + mime_type: quicktime +- extension: avi + mime_type: x-msvideo +- extension: mkv + mime_type: x-matroska +- extension: ogv + mime_type: ogg +- extension: weba + mime_type: webm +- extension: 3gp + mime_type: 3gpp +- extension: 3g2 + mime_type: 3gpp2 +- extension: mid + mime_type: midi diff --git a/_includes/embed/audio.html b/_includes/embed/audio.html new file mode 100644 index 00000000000..d618890af2f --- /dev/null +++ b/_includes/embed/audio.html @@ -0,0 +1,35 @@ +{% assign src = include.src | strip %} +{% assign title = include.title | strip %} +{% assign types = include.types | default: '' | strip | split: '|' %} + +{% unless src contains '://' %} + {%- capture src -%} + {% include img-url.html src=src %} + {%- endcapture -%} +{% endunless %} + +
+ + {% if title %} + {{ title }} + {% endif %} +
diff --git a/_includes/embed/video.html b/_includes/embed/video.html index f0389385f26..72ec4fbeb69 100644 --- a/_includes/embed/video.html +++ b/_includes/embed/video.html @@ -1,9 +1,11 @@ {% assign video_url = include.src %} +{% assign title = include.title %} {% assign poster_url = include.poster %} +{% assign types = include.types | default: '' | strip | split: '|' %} {% unless video_url contains '://' %} {%- capture video_url -%} - {% include img-url.html src=video_url img_path=page.img_path %} + {% include img-url.html src=video_url %} {%- endcapture -%} {% endunless %} @@ -31,8 +33,27 @@ {% endif %}-
diff --git a/_sass/addon/commons.scss b/_sass/addon/commons.scss index c921619e31d..678db47562b 100644 --- a/_sass/addon/commons.scss +++ b/_sass/addon/commons.scss @@ -575,6 +575,13 @@ main { @extend %img-caption; } +.embed-audio { + width: 100%; + display: block; + + @extend %img-caption; +} + /* --- buttons --- */ .btn-lang { border: 1px solid !important;