amp-o2-player
Description
Displays an AOL O2Player.
Required Scripts
<script async custom-element="amp-o2-player" src="https://cdn.ampproject.org/v0/amp-o2-player-0.1.js"></script>
Supported Layouts
Example
The width
and height
attributes determine the aspect ratio of the player embedded in responsive layouts.
Example:
<amp-o2-player data-pid="12345" data-bcid="5678" data-bid="54321" data-vid="98765" layout="responsive" width="480" height="270" > </amp-o2-player>
Attributes
data-pid (required) | The Player ID for the O2Player. |
data-bcid (required) | The Buyer Company ID (bcid) for the O2Player. |
data-bid | The Playlist ID (bid) for the O2Player. |
data-vid | The Video ID (vid) for the O2Player. |
data-macros | The macros for the O2Player. |
common attributes | This element includes common attributes extended to AMP components. |
Validation
See amp-o2-player rules in the AMP validator specification.
The following lists validation errors specific to the amp-o2-player
tag:
Validation Error | Description |
---|---|
The 'example1' tag is missing or incorrect, but required by 'example2'. | Error thrown when required amp-o2-player extension .js script tag is missing or incorrect. |
The implied layout 'example1' is not supported by tag 'example2'. | Error thrown when implied layout is set to CONTAINER ; this layout type isn't supported. |
The specified layout 'example1' is not supported by tag 'example2'. | Error thrown when specified layout is set to CONTAINER ; this layout type isn't supported. |
The property 'example1' in attribute 'example2' in tag 'example3' is set to 'example4', which is invalid. | Error thrown when invalid value is given for attributes height or width . For example, height=auto triggers this error for all supported layout types, with the exception of NODISPLAY . |
Consent Data
Iframe inside amp-o2-player
can send a message to receive consent data if a CMP is present on amp-o2-player
parents page.
Example request for consent data from iframe:
window.parent.postMessage( { sentinel: 'amp', type: 'send-consent-data', }, '*' );
Example receive response for consent data:
function isAmpMessage(event, type) {
return (
event.source == window.parent &&
event.origin != window.location.origin &&
event.data &&
event.data.sentinel == 'amp' &&
event.data.type == type
);
}
window.addEventListener('message', function (event) {
if (!isAmpMessage(event, 'consent-data')) {
return;
}
console.log(event.data.consentData);
});
이 문서를 수십 번 읽었음에도 여전히 궁금한 점이 남아 있나요? 다른 개발자들도 같은 심정일지 모릅니다. Stack Overflow에서 소통해 보세요.
Stack Overflow로 이동 버그나 누락된 기능을 발견하셨나요?AMP 프로젝트는 여러분의 참여와 기여를 적극 환영합니다! 오픈 소스 커뮤니티를 통해 지속적으로 활동해 주셔도 좋지만 관심 있는 주제에 한 번만 기여하셔도 큰 도움이 됩니다.
GitHub로 이동하기