README
Classes
Typedefs
- EmbedAllowedOptions :
Object - PlayerOption :
Object - EndScreenOption :
Object - MetadataOption :
Object - CpcOption :
Object - UserOption :
Object - PlayerEvent
Events fired by the player
EmbedPlayer
Kind: global class
new EmbedPlayer()
Class representing the EmbedPlayer.
embedPlayer.constructor([param])
Kind: instance method of EmbedPlayer
| Param | Type | Default | Description |
|---|---|---|---|
| [param] | Object |
Object param to initialize the EmbedPlayer. | |
| [param.width] | number |
1024 |
Widht for the iframe. |
| [param.height] | number |
1024 |
Height for the iframe. |
| [param.url] | string |
Url of the content to be embedded. | |
| [param.container] | string |
".player-wrapper" |
Container selector for the embed the player (most likely a class name). |
| [param.options] | EmbedAllowedOptions |
{} |
Override some of the player state (each key must be whitelisted). |
Example
const player = new window.Bedrock.EmbedPlayer({
width: 1024,
height: 576,
url: `https://www.my-bedrock-website.com/embed/myEmbeddedService/clipId/hash`,
});
embedPlayer.addEventListener([eventType], [listener])
Add an event listener
Kind: instance method of EmbedPlayer
| Param | Type | Description |
|---|---|---|
| [eventType] | PlayerEvent |
Event to listen to. |
| [listener] | function |
Function to call when the event is raised. |
embedPlayer.removeEventListener([eventType], [listener])
Remove an event listener
Kind: instance method of EmbedPlayer
| Param | Type | Description |
|---|---|---|
| [eventType] | PlayerEvent |
Event that was listened to. |
| [listener] | function |
Function called when the event was raised. |
embedPlayer.isPlayerReady() ⇒ bool
Tells if the embed player and sdk are ready to receive instructions
Kind: instance method of EmbedPlayer
embedPlayer.init()
Creates the iframe and tells the bedrock embed player when it's ready
Kind: instance method of EmbedPlayer
embedPlayer.resume()
Resume the playback.
Note that you shouldn't use that method to force the playback to start. You should let the user click on the call to action to activate the video
Kind: instance method of EmbedPlayer
embedPlayer.pause()
Pauses the playback
Kind: instance method of EmbedPlayer
embedPlayer.mute()
Mutes the video
Kind: instance method of EmbedPlayer
embedPlayer.unmute()
Unmutes the video
Kind: instance method of EmbedPlayer
embedPlayer.stop()
Stops the player and removes the generated iframe
Kind: instance method of EmbedPlayer
EmbedAllowedOptions : Object
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| player | PlayerOption |
player configuration |
PlayerOption : Object
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| muted | bool |
mute configuration |
| endScreen | EndScreenOption |
endScreen configuration |
| metadata | MetadataOption |
metadata configuration |
| cpc | CpcOption |
cpc configuration |
EndScreenOption : Object
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| enabled | bool |
enable the endScreen configuration |
MetadataOption : Object
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| location | string |
location of the player |
CpcOption : Object
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| user | UserOption |
user configuration |
UserOption : Object
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| UID | string |
gigya user UID |
| UIDSignature | string |
gigya user UIDSignature |
| signatureTimestamp | string |
gigya user signatureTimestamp |
PlayerEvent
Events fired by the player
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| PLAYER_READY | string |
Fired when the embed player is ready |
| MUTED_CHANGED | string |
Fired when the player is muted or unmuted |
| PLAYBACK_CHANGED | string |
Fired when the player is paused or played |
| PLAYBACK_ENDED | string |
Fired when the video has ended |