Skip to content

Commit

Permalink
Retain decorateBlockBg logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mokimo committed Sep 9, 2024
1 parent bf367ad commit 253feca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/utils/decorate.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ export function decorateMultiViewport(el) {

export function turnAnchorIntoVideo({ src, anchorTag }) {
const { dataset, parentElement } = anchorTag;
const attrs = getVideoAttrs(anchorTag.hash || 'autoplay', dataset);
const videoLink = anchorTag.querySelector('a[href*=".mp4"]');
if (videoLink && !videoLink.hash) videoLink.hash = 'autoplay';
const attrs = getVideoAttrs(anchorTag.hash, dataset);
const video = `<video ${attrs} data-video-source=${src}></video>`;
anchorTag.insertAdjacentHTML('afterend', video);
const videoEl = parentElement.querySelector('video');
Expand Down

0 comments on commit 253feca

Please sign in to comment.