Skip to content

Commit

Permalink
issue-111 - Fix vimeo URLs under /video/x
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaret committed Jan 23, 2024
1 parent 7ab8e90 commit 99c4efe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cigaradvisor/blocks/video/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function embedYoutube(url, autoplay) {
}

function embedVimeo(url, autoplay) {
const [, video] = url.pathname.split('/');
const video = url.pathname.split('/').at(-1);
const suffix = autoplay ? '?muted=1&autoplay=1' : '';
return `<div style="left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.25%;">
<iframe src="https://player.vimeo.com/video/${video}${suffix}"
Expand Down

0 comments on commit 99c4efe

Please sign in to comment.