Integrating Social Sharing with Brightcove Web & Smart TV SDK
Overview
The Social Sharing Integration enables the inclusion of social sharing buttons within your media player, facilitating easy sharing of content on social networks like Facebook, Twitter, Pinterest, and LinkedIn. This feature enhances viewer engagement and promotes content virality.
Prerequisites
-
A Brightcove account with access to Video Cloud.
-
The Brightcove Web & Smart TV SDK installed in your project.
Usage Example
-
Import the Player (with UI) class from the Brightcove SDK.
import { Player, IntegrationsManager } from '@brightcove/web-sdk/ui';
-
Import the Social Sharing Integration class from the Brightcove SDK.
import { SocialSharingIntegrationFactory } from '@brightcove/web-sdk/integrations/socialSharing';
-
Import the Social Sharing Integration CSS from the Brightcove SDK.
import '@brightcove/web-sdk/integrations/socialSharing/styles';
-
Create and Configure the Player.
const player = new Player({accountId:'<account-id>'}); player.updateConfiguration({ integrations: { socialSharing: { title: 'Social Sharing Overlay Title', description: 'Overlay description...', services: { facebook: true, twitter: true, tumblr: false, pinterest: false, linkedin: false, }, // etc }, }, });
-
Attach the player to a mount root (DOM element in the page):
const root = document.querySelector('#player-mount-root'); player.attach(root);
Configuration Summary
This section provides detailed information about the various configuration options available for Social Sharing Integration when using the Web & Smart TV SDK.
Configuration Option | Type | Default | Description |
---|---|---|---|
title |
string | "" | Used to provide a title for use in the social overlay. Can be updated dynamically. |
description |
string | "" | Used to provide a description for use in the social overlay. Can be updated dynamically. |
url |
string | "" | Used to provide a custom URL that replaces the generated one. Can be updated dynamically. |
label |
string | "" | Used to provide a label for the social overlay. Can only be updated on initialization of the plugin. |
embedCode |
string | "" | Used to provide a custom embed code that replaces the generated one. Can be updated dynamically. |
embedDomain |
string | "players.brightcove.net" | This value is only used when the embed code is not set. Used to provide a custom domain if proxy is being used. Can be updated dynamically. |
embedDimensions |
boolean | false | If true, the current dimensions of the player will be provided in the embed code. Can be updated dynamically. |
deeplinking |
boolean | false | If true, direct links will include a start offset. Can be updated dynamically. |
offset |
string | "00:00:00" | An offset in "hh:mm:ss" format to use for sharing URLs. Can be updated dynamically. |
removeDirect |
boolean | false | If true, turns off the direct link. Can be updated dynamically. |
removeEmbed |
boolean | false | If true, turns off the embed code. Can be updated dynamically. |
services |
SocialSharingConfigurationServices |
|
Can be updated dynamically. |