Package com.brightcove.player.mediacontroller
package com.brightcove.player.mediacontroller
Application developer level documentation for the Brightcove Android media controller. The following describes how
an application developer might use the Brightcove media controller to customize the media controls on an app using
these media controls. Sample snippets are provided on GitHub Gists with links provided below.
This GitHub Gist shows a
Modifying media controller colors.
App developers can override the default colors used in the Brightcove media controller by providing different colors values in their own colors resource file.../res/values/colors.xml
. The color names and their default values
are:
Color Name | Color Value | Description |
---|---|---|
bmc_seekbar_played |
#d52484 | The primary progress color. Indicates how much of the video has played. |
bmc_seekbar_buffered |
white_semi_trans | The secondary progress color. Indicates how much of the video has been buffered. |
bmc_seekbar_track |
white_semi_trans | The seekbar background color. Indicates how much of the video remains to be buffered and played. |
bmc_seekbar_thumb_center |
white | The seekbar thumb button view center color. |
bmc_seekbar_thumb_outside |
white_semi_trans | The seekbar thumb view outer color. |
bmc_seekbar_marker |
white_semi_trans | The seekbar marker color. |
bmc_button |
white_almost_opaque | The default media button foreground color. |
bmc_time_text |
white_almost_opaque | The default time text view foreground color. |
bmc_background |
black_semi_trans | The media controller background color. |
colors.xml
file that modifies the sekbar progress colors to transparent magenta/black/blue.
Changing a button face and hiding a button.
App developers can change the face of a media control button quite easily. The Brightcove media controller uses the Font Awesome toolkit. The rewind operation is a very good example of a button with many acceptable choices. There is the default text undo face (fa-undo), the video player backward (fa-backward) and step-backward (fa-step-backward) faces, as well as the directional arrow-left (fa-arrow-left) face. This Github Gist shows how to apply these three choices. The table below identifies the default button names. The buttons are standard Android Button widgets. To hide a button, an app developer can programmatically use the Button API to accomplish this as shown in this GitHub Gist.Button Name/ID | Default Icon | Description |
---|---|---|
play |
fa-play | The play button. The button shows this face when the video is paused or stopped. |
pause |
fa-pause | The alternate face presented when the video is playing. |
rewind |
fa-undo | The rewind button. When clicked, causes the video to replay the last few seconds of the video. Defaults to three seconds. |
captions |
fa-cc | The captions button. Brings up a dialog for the User to select a closed captions option. |
enter_full_screen |
fa-expand | The enter full screen button. Causes the video to play using the entire screen. |
exit_full_screen |
fa-compress | The exit full screen button. Causes the video to return to it's default size. |
Customizing showing and hiding the control bar.
Applications can show the media controls by either emitting an SDK SHOW_MEDIA_CONTROLS event or calling the show() method from a class implementing the ShowHideController interface, such as the BrightcoveMediaController. Similarly to hide the media controls, applications can emit the SDK HIDE_MEDIA_CONTROLS event or call the hide() method. In either case, a payload can be used to specify either the timeout (an Integer property named SHOW_HIDE_TIMEOUT, a number of milliseconds) or the style (an integer property named SHOW_HIDE_ANIMATION_STYLE with values ANIMATION_STYLE_FADE or ANIMATION_STYLE_HIDE) to be used when showing or hiding the media controls. The new values take effect immediately. Also, either an animation style or a timeout value can be specified as attributes in the layout file using the Brightcove attributes bmc:animation_style (specifying one of "fade" or "slide") or bmc:timeout. The timeout value is an integer number of milliseconds specifying the amount of delay after showing the media controls until they are automatically hidden. A value of 0 will result in the media contrtrols being permanently visible. A number of gists have been provided on GitHub to illustrate how to customize the media controls show/hide operations. This Gist illustrates how to customize the application to always have the media controls displayed after setting a video. This Gist shows how to easily change the show/hide animation style to "slide". This Gist shows how to easily change the media controls show/hide timeout value to five seconds.-
ClassDescriptionProvides a control bar wrapper class.The default Brightcove media controller patterned on the Brightcove Web Player.Defines the interface for managing a collection of controllers for media control buttons which use an icon fontset to present the button operation via a glyph defined by the font.Provides a button controller registry where collections of button controllers are managed.The default
PreviewThumbnailView
in the Thumbnail plugin.Provides a seek bar object that also manages arbitrary markers for chapters, ads or some other purpose.Abstracts the seekbar operations and provides a helper class for the seekbar in general.Abstracts the show/hide operations.The defaultPreviewLoader
used in the Thumbnail plugin.TheDefaultPreviewLoader
Builder.The defaultThumbnailDocument
used in the Thumbnail plugin.AComparator
used to sortTimedThumbnail
s based on their start timeCreates aDefaultThumbnailDocument
with a defaultDefaultTimedThumbnailFilter
Filters a givenThumbnailDocument
alowing a maximum number ofDefaultTimedThumbnailFilter.MAX_NUMBER_OF_TIMED_THUMBNAILS
TimedThumbnail
.A configuration class that can be used to configureBrightcoveMediaController
.The MediaControllerConfig Builder.The key dispatcher interface for the Media Controller.The component responsible for loadingTimedThumbnail
from a givenThumbnailDocument
and the playhead position, into theThumbnailView
.Selects aPreviewThumbnailFormat
from a given list.The representation for the Preview Thumbnail View which contains all the components needed for drawing thumbnail images according to the progress changes.ThisPreviewThumbnailView
's listenerSelects the thumbnail format based on the screen size of the device.Defines the facilities for managing media controls visibility.Thumbnail Component Plugin.The document containing an ordered list ofTimedThumbnail
for a particularVideo
Interface use to create an implementation ofThumbnailDocument
given a list ofTimedThumbnail
An event class containing theEvent
property keys exclusively used in the Thumbnail plugin.Identifies SSAI event types used and emitted within the Thumbnail plugin.The View used by thePreviewLoader
to draw the preview thumbnail image.TheTimedThumbnail
available for a video may be dependent on the duration of such a video, going from dozens to hundreds of images.