diff --git a/app/components/shared/embedded_video_component.rb b/app/components/shared/embedded_video_component.rb index 2fd8c1950..9f4cdbd6a 100644 --- a/app/components/shared/embedded_video_component.rb +++ b/app/components/shared/embedded_video_component.rb @@ -43,9 +43,9 @@ class Shared::EmbeddedVideoComponent < ApplicationComponent def src if server == "Vimeo" - "https://player.vimeo.com/video/" + "https://player.vimeo.com/video/#{match[2]}?dnt=1" elsif server == "YouTube" - "https://www.youtube-nocookie.com/embed/" + "https://www.youtube-nocookie.com/embed/#{match[2]}" end end @@ -54,6 +54,6 @@ class Shared::EmbeddedVideoComponent < ApplicationComponent end def iframe_attributes - tag.attributes(src: "#{src}#{match[2]}", style: "border:0;", allowfullscreen: true, title: title) + tag.attributes(src: src, style: "border:0;", allowfullscreen: true, title: title) end end diff --git a/spec/components/shared/embedded_video_component_spec.rb b/spec/components/shared/embedded_video_component_spec.rb index b13361db7..e4d9e05f6 100644 --- a/spec/components/shared/embedded_video_component_spec.rb +++ b/spec/components/shared/embedded_video_component_spec.rb @@ -33,7 +33,7 @@ describe Shared::EmbeddedVideoComponent do it "embeds a vimeo video for vimeo URLs" do allow(record).to receive(:video_url).and_return "https://vimeo.com/7232823" - embed_url = "https://player.vimeo.com/video/7232823" + embed_url = "https://player.vimeo.com/video/7232823?dnt=1" render_inline component diff --git a/spec/system/proposals_spec.rb b/spec/system/proposals_spec.rb index 3fbcb5b92..459f7c619 100644 --- a/spec/system/proposals_spec.rb +++ b/spec/system/proposals_spec.rb @@ -315,7 +315,7 @@ describe "Proposals" do visit proposal_path(proposal) within "#js-embedded-video" do - expect(page).to have_css "iframe[src='https://player.vimeo.com/video/7232823']" + expect(page).to have_css "iframe[src='https://player.vimeo.com/video/7232823?dnt=1']" end end