The Brightcove Video Cloud is an online platform used to host videos. The amp-brightcove is an amp component which is used to embed a brightcove video perform player or a brightcove video cloud.
Required Scripts: Importing brightcove component in the header
HTML
< script async custom-element = "amp-brightcove" src = </ script > |
Attributes:
- data-account: The Brightcove Video Cloud account ID.
- data-video-id: The Brightcove Video Cloud ID.
- data-player-id: The Brightcove player ID. This is a Globally Unique Identifier(GUID).
- data-playlist-id: The Brightcove Video Cloud playlist id. If both a playlist and a video are specified, the playlist takes preference over video.
- autoplay: If this attribute is specified then the video will start automatically.
- dock: If this attribute is specified and if the video is playing manually the video will be minimized. The amp-video-docking extension is required to use this attribute.
A brightcove video is embedded as given below, a data-account, data-video-id, data-player-id is required.
HTML
< amp-brightcove data-account = "906043040001" data-video-id = "1401169490001" data-player-id = "180a5658-8be8-4f33-8eba-d562ab41b40c" layout = "responsive" width = "480" height = "270" > </ amp-brightcove > |
For brightcove player configuration instruction you can check the following Brightcove’s support documentation. https://amp.dev/documentation/components/amp-brightcove/?format=websites
Example:
HTML
<!doctype html> < html amp> < head > < meta charset = "utf-8" > < title >Google AMP amp-brightcove</ title > < script async src = </ script > <!-- Import the Brightcove component in the header. --> < script async custom-element = "amp-brightcove" src = </ script > < meta name = "viewport" content = "width=device-width,minimum-scale=1,initial-scale=1" > < link rel = "canonical" href = < style amp-boilerplate> body { -webkit-animation: -amp-start 8s steps(1, end) 0s 1 normal both; -moz-animation: -amp-start 8s steps(1, end) 0s 1 normal both; -ms-animation: -amp-start 8s steps(1, end) 0s 1 normal both; animation: -amp-start 8s steps(1, end) 0s 1 normal both } @-webkit-keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } @-moz-keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } @-ms-keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } @-o-keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } @keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } </ style > < noscript > < style amp-boilerplate> body { -webkit-animation: none; -moz-animation: none; -ms-animation: none; animation: none } </ style > </ noscript > </ head > < body > < amp-brightcove data-account = "906043040001" data-video-id = "1401169490001" data-player-id = "180a5658-8be8-4f33-8eba-d562ab41b40c" layout = "responsive" width = "480" height = "270" > </ amp-brightcove > </ body > </ html > |
Output: