選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

27 行
914 B

  1. import './video.scss';
  2. import {createElement} from "../../_global/scripts/helpers";
  3. export const createVideo = ({
  4. videoSrc = 'https://cdn.jsdelivr.net/npm/big-buck-bunny-1080p@0.0.6/video.mp4',
  5. posterSrc = 'https://source.unsplash.com/T5nXYXCf50I/880x495',
  6. caption = 'Lorem ipsum dolor sit amet consetetur',
  7. copyright = '© Marco Mustermann für Mustervideos',
  8. }) => {
  9. const figure = createElement('figure', ['video']);
  10. const videoBox = createElement('div', ['video-box'], null, figure);
  11. const video = createElement('video', [], null, videoBox);
  12. video.src = videoSrc;
  13. video.controls = true;
  14. if (posterSrc && posterSrc.length > 0) {
  15. video.poster = posterSrc;
  16. }
  17. if (copyright && copyright.length > 0) {
  18. createElement('span', ['copyright'], copyright, videoBox);
  19. }
  20. if (caption && caption.length > 0) {
  21. createElement('figcaption', [], caption, figure);
  22. }
  23. return figure;
  24. }