Class: IntegrationElement
Web component to integrate the player.
See
IntegrationElementEventMap for a full list of event types and their payloads
Tagname
glomex-integration
Slot
- (optional) Slot for custom media items (GlomexMediaItemElement, ExternalMediaItemElement or MediaItemElement)
Example
<glomex-integration
integration-id="REPLACE_WITH_INTEGRATION_ID"
playlist-id="REPLACE_WITH_PLAYLIST_ID"
></glomex-integration>
You can find more advanced examples in the GlomexMediaItemElement, ExternalMediaItemElement or MediaItemElement documentation.
Extends
LitElement
Properties
hidden
hidden:
boolean
=false
Hides the integration element when set to true
.
Attribute
hidden
Overrides
LitElement.hidden
IntegrationEvent
static
IntegrationEvent: typeofIntegrationEvent
KnownMarkerName
static
KnownMarkerName: typeofKnownMarkerName
MarkerType
static
MarkerType: typeofMarkerType
Mimetype
static
Mimetype: typeofMimetype
PresentationMode
static
PresentationMode: typeofPresentationMode
StreamType
static
StreamType: typeofStreamType
topLevelIframe
topLevelIframe:
boolean
=false
An optional flag that can mark the integration as if it is running in a top-level window context. Useful when the embedded iframe represents an article, which contains this integration.
Attribute
top-level-iframe
index?
optional
index:number
=undefined
Determines the index of the media item within the playlist that should or is currently selected.
Attribute
index
integrationId?
optional
integrationId:string
The identifier for this integration. This value is used to determine the configuration and behavior of the integration.
Attribute
integration-id
placement?
optional
placement:string
Allows the publisher to provide an optional placement attribute, which supplies additional contextual information for enhanced analytics tracking.
Attribute
placement
playlistId?
optional
playlistId:string
Defines the playlist / content identifier that should be loaded and managed by the integration. It can be a single content id, a playlist id or auto
.
It must be empty when the content is provided via the media-item
web components inside the integration.
Attribute
playlist-id
Accessors
adCurrentTime
Get Signature
get adCurrentTime():
number
Returns the current playback time (in seconds) for the ad content. If no ad is currently active, this value is NaN
.
Returns
number
adDuration
Get Signature
get adDuration():
number
Retrieves the total duration (in seconds) of the ad content. If no ad is currently active, this value is NaN
.
Returns
number
adMuted
Get Signature
get adMuted():
undefined
|boolean
Returns whether the ad playback is muted. If no ad is currently active, this value is undefined
.
Returns
undefined
| boolean
adPaused
Get Signature
get adPaused():
undefined
|boolean
Indicates whether the ad playback is currently paused. If no ad is currently active, this value is undefined
.
Returns
undefined
| boolean
adVolume
Get Signature
get adVolume():
undefined
|number
Retrieves the volume level for the ad playback. If no ad is currently active, this value is undefined
.
Returns
undefined
| number
consent
Get Signature
get consent():
undefined
|Consent
Provides access to the user’s consent information.
Returns
undefined
| Consent
content
Get Signature
get content():
undefined
|MediaItem
Retrieves the currently selected content item.
Returns
undefined
| MediaItem
contentPlaybackTime
Get Signature
get contentPlaybackTime():
number
Retrieves the playback time (in seconds) of the current content.
Returns
number
currentAd
Get Signature
get currentAd():
undefined
|Ad
Retrieves details about the currently selected ad, if any.
Returns
undefined
| Ad
currentTime
Get Signature
get currentTime():
number
Returns the current playback time (in seconds) of the media.
Returns
number
Set Signature
set currentTime(
time
):void
Seeks the media to the specified time, updating the current playback time.
Parameters
time
number
The time (in seconds) to seek to.
Returns
void
duration
Get Signature
get duration():
number
Retrieves the total duration (in seconds) of the current media content.
Returns
number
muted
Get Signature
get muted():
boolean
Indicates whether the media playback is currently muted.
Returns
boolean
Set Signature
set muted(
value
):void
Mutes or unmutes the media playback.
Parameters
value
boolean
A boolean value indicating whether to mute the media playback.
Returns
void
page
Get Signature
get page():
undefined
|Page
Retrieves information about the detected page.
Returns
undefined
| Page
paused
Get Signature
get paused():
boolean
Returns true
if the media playback is currently paused; otherwise, returns false
.
Returns
boolean
playlist
Get Signature
get playlist():
undefined
|MediaItem
[]
Retrieves the current playlist content items.
Returns
undefined
| MediaItem
[]
presentationMode
Get Signature
get presentationMode():
PresentationMode
Retrieves the current presentation mode of the media player. This mode may affect how the media is displayed.
Returns
seeking
Get Signature
get seeking():
boolean
Indicates whether the media is currently in a seeking state.
Returns
boolean
volume
Get Signature
get volume():
number
Returns the current volume level of the media playback (0-1).
Returns
number
Set Signature
set volume(
value
):void
Sets the media playback volume to the specified level.
Parameters
value
number
The volume level to be set (0-1).
Returns
void
wallClockTime
Get Signature
get wallClockTime():
number
Returns the current wall clock time (UNIX timestamp in seconds). Useful for livestreams.
Returns
number
Methods
exitCurrentPresentationMode()
exitCurrentPresentationMode(
options
?):void
Exits the current presentation mode.
Parameters
options?
Optional configuration.
byUser?
boolean
Indicates if the change was initiated by a user action.
Returns
void
pause()
pause():
void
Pauses the current media playback.
Returns
void
play()
play():
void
Initiates playback of the media content.
Returns
void
setPresentationMode()
setPresentationMode(
mode
,options
?):void
Sets the presentation mode of the media player to the specified mode. This mode affects how the integration gets displayed (e.g. inline, dock, lightbox, fullscreen).
Parameters
mode
The presentation mode to set.
"fullscreen"
| "hidden"
| "inline"
| "dock"
| "lightbox"
| "amp-dock"
| PresentationMode
options?
Optional configuration.
byUser?
boolean
= false
Indicates if the change was initiated by a user action.
Returns
void