Module: Pageflow::EmbeddedVideo::ConsentHelper Private

Includes:
PageflowPaged::ThirdPartyEmbedConsentHelper
Defined in:
app/helpers/pageflow/embedded_video/consent_helper.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
26
27
28
29
30
# File 'app/helpers/pageflow/embedded_video/consent_helper.rb', line 23

def embedded_video_consent_vendor_name(configuration)
  if configuration['display_embedded_video_url'] =~ /youtube\.com/ ||
     configuration['display_embedded_video_url'] =~ /youtu\.be/
    'youtube'
  elsif configuration['display_embedded_video_url'] =~ /vimeo\.com/
    'vimeo'
  end
end

#embedded_video_opt_in(entry, configuration) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/pageflow/embedded_video/consent_helper.rb', line 7

def embedded_video_opt_in(entry, configuration)
  vendor_name = embedded_video_consent_vendor_name(configuration)
  return unless vendor_name

  vendor_display_name = I18n.t(
    "pageflow.public.embedded_video.consent.#{vendor_name}.vendor_name"
  )

  third_party_embed_opt_in(
    entry: entry,
    vendor_name: vendor_name,
    message: t('pageflow.public.embedded_video.opt_in_prompt',
               vendor: vendor_display_name)
  )
end