diff --git a/extensions/amp-brid-player/0.1/amp-brid-player.js b/extensions/amp-brid-player/0.1/amp-brid-player.js index c6074b1e0049..1fa12021de45 100644 --- a/extensions/amp-brid-player/0.1/amp-brid-player.js +++ b/extensions/amp-brid-player/0.1/amp-brid-player.js @@ -12,6 +12,7 @@ import { } from '#core/dom/fullscreen'; import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {propagateAttributes} from '#core/dom/propagate-attributes'; +import {childElementsByTag} from '#core/dom/query'; import {htmlFor} from '#core/dom/static-template'; import {PauseHelper} from '#core/dom/video/pause-helper'; @@ -143,10 +144,15 @@ class AmpBridPlayer extends AMP.BaseElement { '/?amp=1'; // Append child JSON config if supplied - try { - const customConfig = getChildJsonConfig(this.element); - src += '&cust_config=' + JSON.stringify(customConfig); - } catch (e) {} + if (childElementsByTag(this.element, 'script').length) { + try { + const customConfig = getChildJsonConfig(this.element); + src += + '&cust_config=' + encodeURIComponent(JSON.stringify(customConfig)); + } catch (e) { + this.user().warn(TAG, 'Ignoring the + + + + + + + + + + + + + + + +
+ +
+
+ + + + diff --git a/extensions/amp-brid-player/0.1/test/validator-amp-brid-player.out b/extensions/amp-brid-player/0.1/test/validator-amp-brid-player.out index 7f347c2f511a..48ae86934bd3 100644 --- a/extensions/amp-brid-player/0.1/test/validator-amp-brid-player.out +++ b/extensions/amp-brid-player/0.1/test/validator-amp-brid-player.out @@ -84,5 +84,69 @@ amp-brid-player/0.1/test/validator-amp-brid-player.html:72:2 The attribute 'dock | layout="responsive" | width="480" height="270"> | +| +| +| +| +| +| +| +| +| +| +| +>> ^~~~~~~~~ +amp-brid-player/0.1/test/validator-amp-brid-player.html:105:4 The parent tag of tag 'amphtml engine script' is 'amp-brid-player', but it can only be 'head'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup) +| +| +| +| +>> ^~~~~~~~~ +amp-brid-player/0.1/test/validator-amp-brid-player.html:114:4 The text inside tag 'script' contains 'html comments', which is disallowed. (see https://amp.dev/documentation/components/amp-brid-player/) +| +| +| +|
+| +>> ^~~~~~~~~ +amp-brid-player/0.1/test/validator-amp-brid-player.html:124:6 The parent tag of tag 'amphtml engine script' is 'div', but it can only be 'head'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup) +|
+|
+| +| +| +>> ^~~~~~~~~ +amp-brid-player/0.1/test/validator-amp-brid-player.html:134:4 The attribute 'src' may not appear in tag 'script'. (see https://amp.dev/documentation/components/amp-brid-player/) +| | | diff --git a/extensions/amp-brid-player/amp-brid-player.md b/extensions/amp-brid-player/amp-brid-player.md index ee23adfe18e2..fc1da557216d 100644 --- a/extensions/amp-brid-player/amp-brid-player.md +++ b/extensions/amp-brid-player/amp-brid-player.md @@ -3,12 +3,17 @@ $category@: media formats: - websites teaser: - text: Displays a Brid.tv player. + text: Displays a TargetVideo player. --- # amp-brid-player -An `amp-brid-player` displays the Brid Player used in [Brid.tv](https://www.brid.tv/) Video Platform. +An `amp-brid-player` displays the TargetVideo player (formerly Brid Player) used in the [TargetVideo](https://target-video.com/) video platform. + +It is also available as `amp-target-video-player`, which takes the same +attributes. Both tag names come from the `amp-brid-player` extension, so a page +that uses `amp-target-video-player` still needs the +` + +``` + ## Actions ### `play` @@ -107,4 +139,4 @@ Takes the video to fullscreen. ## Validation -See [amp-brid-player rules](https://github.com/ampproject/amphtml/blob/main/extensions/amp-brid-player/validator-amp-brid-player.protoascii) in the AMP validator specification. +See [amp-brid-player rules](validator-amp-brid-player.protoascii) in the AMP validator specification. diff --git a/extensions/amp-brid-player/validator-amp-brid-player.protoascii b/extensions/amp-brid-player/validator-amp-brid-player.protoascii index e3d7f4aea171..9468a6fbd0f8 100644 --- a/extensions/amp-brid-player/validator-amp-brid-player.protoascii +++ b/extensions/amp-brid-player/validator-amp-brid-player.protoascii @@ -118,3 +118,45 @@ tags: { # supported_layouts: RESPONSIVE } } +tags: { # > script[type=application/json] + html_format: AMP + tag_name: "SCRIPT" + spec_name: "amp-brid-player > script[type=application/json]" + mandatory_parent: "AMP-BRID-PLAYER" + requires_extension: "amp-brid-player" + attrs: { + name: "type" + mandatory: true + value_casei: "application/json" + dispatch_key: NAME_VALUE_PARENT_DISPATCH + } + attr_lists: "nonce-attr" + cdata: { + disallowed_cdata_regex: { + regex: "