Problem/Motivation

AMP seems to be the hot new shit, so, well, let's provide a formatter which uses the built in AMP brightcove component.

Proposed resolution

This patch is build upon #2803173: Add a field formatter for the player

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#4 interdiff.txt807 bytesdawehner
#4 2817233-4.patch3.39 KBdawehner
#2 2817233-2.patch3.36 KBdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner created an issue. See original summary.

dawehner’s picture

Status: Active » Needs review
FileSize
3.36 KB

Here is a patch for it.

Boobaa’s picture

Issue tags: +D8Media, +Usability
dawehner’s picture

FileSize
3.39 KB
807 bytes

This fixes the actual rendering of the video

Boobaa’s picture

Status: Needs review » Needs work
+++ b/templates/brightcove-amp-video-player.html.twig
@@ -0,0 +1,29 @@
+{{ attach_library('amp/amp.brightcove') }}

How do you plan to depend on AMP.module if at all? If I understand this correctly, this line could cause some problems if amp.module's library is unavailable. Or does this patch have a counterpart in amp.module?

dawehner’s picture

+++ b/src/Plugin/Field/FieldFormatter/BrightcoveAmpVideoPlayerFormatter.php
@@ -0,0 +1,49 @@
+  public static function isApplicable(FieldDefinitionInterface $field_definition) {
+    return parent::isApplicable($field_definition) && \Drupal::moduleHandler()->moduleExists('amp');
+  }

Note: You could just configure this formatter, if the module exists.

yce’s picture

Status: Needs work » Closed (won't fix)

Since it seems like google doesn't provide any advantages in the future using AMP, I would rather not include it in the module.

If anyone needs this, it should be possible to create an amp page with a custom template.

https://www.digitalphablet.com/google-kills-google-amp/
https://developers.google.com/search/blog/2021/04/more-details-page-expe...