Packagecom.brightcove.api.modules
Classpublic class MenuModule
InheritanceMenuModule Inheritance APIModule Inheritance flash.events.EventDispatcher

API class for handling menu interaction. See the article, Customizing the Player Menu's Additional Media for code examples.



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
  
MenuModule(module:Object)
Constructor.
MenuModule
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = true):void
[override] Adds a listener for an event.
APIModule
  
Closes the menu page and icon menu, if opened.
MenuModule
  
getAdditionalMediaForType(type:String):Array
Returns the additional media loaded for the given type.
MenuModule
  
Returns the string name of the current menu page.
MenuModule
  
Gets the overlay menu visibility.
MenuModule
  
Returns whether or not a menu page is showing.
MenuModule
  
Returns whether or not the overlay menu is showing.
MenuModule
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
[override] Removes a listener for an event.
APIModule
  
Removes overlay menu from player.
MenuModule
  
setAdditionalMediaCallback(callback:Function, types:Array = null):void
Sets the callback for when additional media needs to be requested for the current media in the player.
MenuModule
  
setAdditionalMediaForType(media:Array, type:String):void
Sets the additional media to display for a specific type for the current media in the player.
MenuModule
  
setOverlayMenuVisible(visible:Boolean):void
Sets the overlay menu visibility.
MenuModule
  
showMenuPage(page:String):void
Shows specified menu page
MenuModule
Events
 Event Summary Defined By
  Dispatched when an entry has been posted to a blog through the blog menu page.MenuModule
  Dispatched when the "Copy Code" button on the "Get Code" menu page has been clicked.MenuModule
  Dispatched when the "Copy Link" button on the "Get Link" or "Share" menu page has been clicked.MenuModule
  Dispatched when a menu page has been closed.MenuModule
  Dispatched when a menu page has been opened.MenuModule
  Dispatched when the overlay menu has been closed.MenuModule
  Dispatched when the overlay menu has been opened.MenuModule
  Dispatched when the overlay menu play icon has been clicked.MenuModule
  Dispatched when the "Send Email" button on the "Email This" menu page has been clicked.MenuModule
  Dispatched when a video has been selected from the Info menu's list of additional videos.MenuModule
Public Constants
 ConstantDefined By
  CODE : String = Embed
[static]
MenuModule
  EMAIL : String = Email
[static]
MenuModule
  INFO : String = Info
[static]
MenuModule
  LINK : String = Link
[static]
MenuModule
  MOST_VIEWED_VIDEOS : String = most viewed videos
[static]
MenuModule
  NEWEST_VIDEOS : String = newest videos
[static]
MenuModule
  RELATED_VIDEOS : String = related videos
[static]
MenuModule
  SHARE : String = Share
[static]
MenuModule
Constructor Detail
MenuModule()Constructor
public function MenuModule(module:Object)

Constructor.

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

Closes the menu page and icon menu, if opened.

getAdditionalMediaForType()method 
public function getAdditionalMediaForType(type:String):Array

Returns the additional media loaded for the given type. This should be an array of MediaDTOs.

Parameters

type:String — type that this array of media represents.

Returns
Array — The array of MediaDTOs loaded for the given type.
getCurrentMenuPage()method 
public function getCurrentMenuPage():String

Returns the string name of the current menu page.

Returns
String — String name of the current menu page.
getOverlayMenuVisible()method 
public function getOverlayMenuVisible():Boolean

Gets the overlay menu visibility.

Returns
Boolean — Whether or not the overlay menu is visible.
isMenuPageShowing()method 
public function isMenuPageShowing():Boolean

Returns whether or not a menu page is showing.

Returns
Boolean — Boolean specifying whether or not a menu page is showing.
isOverlayMenuShowing()method 
public function isOverlayMenuShowing():Boolean

Returns whether or not the overlay menu is showing.

Returns
Boolean — Boolean specifying whether or the overlay menu is showing.
removeOverlayMenu()method 
public function removeOverlayMenu():void

Removes overlay menu from player.

setAdditionalMediaCallback()method 
public function setAdditionalMediaCallback(callback:Function, types:Array = null):void

Sets the callback for when additional media needs to be requested for the current media in the player. This additional media is displayed in the Brightcove menu Info screen. This function should have the following signature: public function callbackFunction(type:String, media:MediaDTO=null):Boolean The Boolean return value represents if this call will be handled (true) or if the player should default to its own methods (false). If null is passed for the callback, then the default logic of the menu is used for fetching of additional vidoes. If null is passed for the types, then the default tabs are used in the Info menu, "related videos", "most viewed" and "newest".

Parameters

callback:Function — function that should be called to get additional media for the current media.
 
types:Array (default = null) — types of additional media that can be selected for the current media. An array of strings. If nothing is passed, then the default types in the playter are used, RELATED_VIDEOS, MOST_VIEWED_VIDEOS, NEWEST_VIDEOS.

setAdditionalMediaForType()method 
public function setAdditionalMediaForType(media:Array, type:String):void

Sets the additional media to display for a specific type for the current media in the player. This should be an array of MediaDTO.

Parameters

media:Array — array of MediaDTOs to display for the given type.
 
type:String — type that this array of media represents.

setOverlayMenuVisible()method 
public function setOverlayMenuVisible(visible:Boolean):void

Sets the overlay menu visibility.

Parameters

visible:Boolean — or not the overlay menu is visible.

showMenuPage()method 
public function showMenuPage(page:String):void

Shows specified menu page

Parameters

page:String — specifying menu page to show.

Event Detail
blogPostClick Event
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.BLOG_POST_CLICK

Dispatched when an entry has been posted to a blog through the blog menu page.

The MenuEvent.BLOG_POST_CLICK constant defines the value of the type property of the event object for a blogPostClick event.
copyCode Event  
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.COPY_CODE

Dispatched when the "Copy Code" button on the "Get Code" menu page has been clicked.

The MenuEvent.COPY_CODE constant defines the value of the type property of the event object for a copyCode event.
copyLink Event  
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.COPY_LINK

Dispatched when the "Copy Link" button on the "Get Link" or "Share" menu page has been clicked.

The MenuEvent.COPY_LINK constant defines the value of the type property of the event object for a copyLink event.
menuPageClose Event  
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.MENU_PAGE_CLOSE

Dispatched when a menu page has been closed.

The MenuEvent.MENU_PAGE_CLOSE constant defines the value of the type property of the event object for a menuPageClose event.
menuPageOpen Event  
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.MENU_PAGE_OPEN

Dispatched when a menu page has been opened.

The MenuEvent.MENU_PAGE_OPEN constant defines the value of the type property of the event object for a menuPageOpen event.
overlayMenuClose Event  
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.OVERLAY_MENU_CLOSE

Dispatched when the overlay menu has been closed. This means that rollover of the video will not reveal the menu. Rolling off the video causing the menu to be hidden but awaiting further interaction does not fire this event.

The MenuEvent.OVERLAY_MENU_CLOSE constant defines the value of the type property of the event object for a overlayMenuClose event.
overlayMenuOpen Event  
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.OVERLAY_MENU_OPEN

Dispatched when the overlay menu has been opened. This means that rollover of the video will reveal the menu. When the menu is hidden by the user rolling off then revealed again by rollover, this event is not fired again. The event corresponds to the presence of the menu awaiting interaction, not its visible/hidden states due to mouse interaction.

The MenuEvent.OVERLAY_MENU_OPEN constant defines the value of the type property of the event object for a overlayMenuOpen event.
overlayMenuPlayClick Event  
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.OVERLAY_MENU_PLAY_CLICK

Dispatched when the overlay menu play icon has been clicked.

The MenuEvent.OVERLAY_MENU_PLAY_CLICK constant defines the value of the type property of the event object for a overlayMenuPlayClick event.
sendEmailClick Event  
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.SEND_EMAIL_CLICK

Dispatched when the "Send Email" button on the "Email This" menu page has been clicked.

The MenuEvent.SEND_EMAIL_CLICK constant defines the value of the type property of the event object for a sendEmailClick event.
videoRequest Event  
Event Object Type: com.brightcove.api.events.MenuEvent
MenuEvent.type property = com.brightcove.api.events.MenuEvent.VIDEO_REQUEST

Dispatched when a video has been selected from the Info menu's list of additional videos.

The MenuEvent.VIDEO_REQUEST constant defines the value of the type property of the event object for a videoRequest event.
Constant Detail
CODEConstant
public static const CODE:String = Embed

EMAILConstant 
public static const EMAIL:String = Email

INFOConstant 
public static const INFO:String = Info

LINKConstant 
public static const LINK:String = Link

MOST_VIEWED_VIDEOSConstant 
public static const MOST_VIEWED_VIDEOS:String = most viewed videos

NEWEST_VIDEOSConstant 
public static const NEWEST_VIDEOS:String = newest videos

RELATED_VIDEOSConstant 
public static const RELATED_VIDEOS:String = related videos

SHAREConstant 
public static const SHARE:String = Share