🌐 这是英文版本

查看中文原文:多媒体内容示例

View original Chinese version

🌐 This is the English version. 查看中文原文

This article demonstrates how to embed videos, audio, and galleries in your blog posts.

Video Display

You can easily embed local or remote videos:

Demo Video

This is a demo video

Note: You need to upload video files to the static/videos/ directory (MP4 format recommended).

Audio Playback

Support for MP3 audio playback with a beautiful player interface:

Background Music

Background Music

Artist

Instructions

Upload Files

Place multimedia files in the corresponding directories:

  • Video: static/videos/ (MP4 format)
  • Audio: static/audio/ (MP3 format)
  • Images: static/img/ (JPG, PNG formats)

Shortcode Syntax

Video:

{{< video src="/videos/filename.mp4" poster="/img/cover.jpg" title="Title" >}}

Audio:

{{< audio src="/audio/filename.mp3" title="Title" artist="Artist" >}}

Gallery:

{{< gallery >}}
  {{< figure src="/img/image1.jpg" title="Description" >}}
  {{< figure src="/img/image2.jpg" title="Description" >}}
{{< /gallery >}}

Notes

  1. Video files should use H.264 encoded MP4 format for best compatibility
  2. Audio files should use MP3 format
  3. Large files should be compressed before uploading
  4. You can use CDN or object storage to host multimedia files

Feel free to leave a comment below!