Packagecom.brightcove.api.modules
Classpublic class SocialModule
InheritanceSocialModule Inheritance APIModule Inheritance flash.events.EventDispatcher

API class for handling social features, like sharing. For code examples that use SocialModule, see the articles, Post to MySpace Widget and Making a Video Link to the Current Page.



Public Properties
 PropertyDefined By
 Inheritedmodule : Object
[read-only] Returns the instance of the module that is wrapped by this instance.
APIModule
Public Methods
 MethodDefined By
  
SocialModule(module:Object)
Constructor.
SocialModule
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = true):void
[override] Adds a listener for an event.
APIModule
  
enableBlogging(enable:Boolean):void
Enables or disables blog options for the player, if they were previously enabled in the player settings.
SocialModule
  
getEmbedCode(id:Number = -1):void
Retrieves the embed code for a specific video.
SocialModule
  
getLink():String
Creates and returns the link for the current experience.
SocialModule
  
isURLShortenedForMedia(mediaID:Number):Boolean
Returns whether the shortened URL has been generated (or attempted) for the specified media.
SocialModule
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
[override] Removes a listener for an event.
APIModule
  
setEmbedCode(code:String):void
Sets the embed code that will be shown in and copied from the player.
SocialModule
  
setLink(linkURL:String):void
Sets a new link that will be used in the Get Link menu state as well as in emailed videos.
SocialModule
  
shareVideoViaEmail(fromEmail:String, toEmail:String, message:String):Boolean
Sends a link the current video via email.
SocialModule
Events
 Event Summary Defined By
  Dispatched when the embed code for a video is retrieved from the server.SocialModule
  Dispatched when a shortened link to the player and video is retrieved from the server.SocialModule
Public Constants
 ConstantDefined By
  EMBED_CODE_RETRIEVED : String = embedCodeRetrieved
[static] Event type constant
SocialModule
  LINK_GENERATED : String = linkGenerated
[static] Event type constant
SocialModule
Constructor Detail
SocialModule()Constructor
public function SocialModule(module:Object)

Constructor.

Parameters
module:Object — module to wrap with this API class.
Method Detail
enableBlogging()method
public function enableBlogging(enable:Boolean):void

Enables or disables blog options for the player, if they were previously enabled in the player settings.

Parameters

enable:Boolean — to enable the blog features in the player.

getEmbedCode()method 
public function getEmbedCode(id:Number = -1):void

Retrieves the embed code for a specific video. The result is not returned directly from this method and is instead returned within the embedCodeRetrieved event. You must listen for this event in order to get the embed code.

Parameters

id:Number (default = -1) — video id of the video to use when retrieving the embed code. If a video id is not specified then the embed code will be retrieved for the current video.

getLink()method 
public function getLink():String

Creates and returns the link for the current experience. This returns the same string that is shown in the Get Link state of the menu.

Returns
String — String that is the experience link.
isURLShortenedForMedia()method 
public function isURLShortenedForMedia(mediaID:Number):Boolean

Returns whether the shortened URL has been generated (or attempted) for the specified media. getLink() will always return the current link to the media. If this link has not yet been shortened by the backend service, a developer may wish to know this in order to set up a listener to be informed when a shortened link has been retrieved in order to surface this in a custom UI, for instance. This method will also return true if the shortened link has been requested and there was an error. At that point a shortened link to that media will not be requested again.

Parameters

mediaID:Number — The ID of the media to check for a shortened url link to.

Returns
Boolean — True if the shortened url has been previously requested.
setEmbedCode()method 
public function setEmbedCode(code:String):void

Sets the embed code that will be shown in and copied from the player. This automatically disables blog options in the player since the embed code used for blogging will not be altered by this method. To enable the blog options, use enableBlogging(true). This will display the blog controls in the player menu, but the embed code used for blogs will be the default Brightcove embed code.

Parameters

code:String — embed code snippet that will be shown for the player.

setLink()method 
public function setLink(linkURL:String):void

Sets a new link that will be used in the Get Link menu state as well as in emailed videos.

Parameters

linkURL:String — url to use as the base of the link.

shareVideoViaEmail()method 
public function shareVideoViaEmail(fromEmail:String, toEmail:String, message:String):Boolean

Sends a link the current video via email.

Parameters

fromEmail:String — string containing the email of the sender.
 
toEmail:String — comma-delimited string of email addresses to send the link to.
 
message:String — optional string containing a message from the sender.

Returns
Boolean — True if pFromEmail and pToEmails are all valid email address. False if any are not valid, in which case, mail will not be sent.
Event Detail
embedCodeRetrieved Event
Event Object Type: com.brightcove.api.events.EmbedCodeEvent
EmbedCodeEvent.type property = com.brightcove.api.events.EmbedCodeEvent.EMBED_CODE_RETRIEVED

Dispatched when the embed code for a video is retrieved from the server. See EmbedCodeEvent for more details on this event.

The EmbedCodeEvent.EMBED_CODE_RETRIEVED constant defines the value of the type property of the event object for a embedCodeRetrieved event.
linkGenerated Event  
Event Object Type: com.brightcove.api.events.ShortenedLinkEvent
ShortenedLinkEvent.type property = com.brightcove.api.events.ShortenedLinkEvent.LINK_GENERATED

Dispatched when a shortened link to the player and video is retrieved from the server. See ShortenedLinkEvent for more details on this event.

The ShortenedLinkEvent.LINK_GENERATED constant defines the value of the type property of the event object for a linkGenerated event.
Constant Detail
EMBED_CODE_RETRIEVEDConstant
public static const EMBED_CODE_RETRIEVED:String = embedCodeRetrieved

Event type constant

LINK_GENERATEDConstant 
public static const LINK_GENERATED:String = linkGenerated

Event type constant