You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

4 years ago
  1. +++
  2. title = "Video"
  3. description = "Lazy-load videos and control playback options."
  4. categories = ["experience"]
  5. tags = []
  6. html_attributes = ["class", "autoplay", "controls", "crossorigin", "height", "loop", "muted", "preload", "intrinsicsize", "poster", "src", "width", "playsinline"]
  7. custom_attributes = []
  8. snippets_used = []
  9. [[copyright]]
  10. owner = "Josh Habdas"
  11. date = "2019"
  12. license = "agpl-3.0-or-later"
  13. +++
  14. Basic usage:
  15. ```html
  16. {{</* video autoplay="true" loop="true" src="assets/sample.mp4" */>}}
  17. ```
  18. {{< video autoplay="true" loop="true" src="assets/sample.mp4" >}}
  19. Assumes the following directory structure:
  20. ```
  21. ├── assets
  22. ├── content
  23. │   └── videos
  24. │   └── gifs
  25. │   ├── assets
  26. │   │ └── sample.mp4
  27. │   └── index.md
  28. ├── content
  29. ```
  30. With controls:
  31. ```html
  32. {{</* video controls="true" src="assets/sample.mp4" */>}}
  33. ```
  34. {{< video controls="true" src="assets/sample.mp4" >}}
  35. Absolute `src` and `poster` URLs also possible. Absolute URLs must include a scheme such as `http` or `https`. Root-relative URLs not currently possible.