public class MediaSelectControlImpl extends Object implements MediaSelectControl, ServiceContextListener
Player. It serves as a high
level demultiplex control, where the selection is specified by
locators indicating one or more service components to present.
If the Player on which a
MediaSelectControlImpl operates is an instance of
ServiceMediaHandler, then
MediaSelectControlImpl is restricted to demultiplexing
only content from the Service with which the
ServiceMediaHandler is associated.
ServiceMediaHandler| Constructor and Description |
|---|
MediaSelectControlImpl(Handler handler,
ServiceContextImpl context)
Constructs a new media select control
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Locator component)
Adds a service component (for example, sub-titles) to the
presentation.
|
void |
addMediaSelectListener(MediaSelectListener listener)
Subscribes the specifed
MediaSelectListener to
receive events related to media selection on this Player. |
Component |
getControlComponent()
Get the
Component associated with this
Control object. |
Locator[] |
getCurrentSelection()
Reports the components of the current selection.
|
void |
receiveServiceContextEvent(ServiceContextEvent e)
Notifies the
ServiceContextListener of an event
generated by a ServiceContext. |
void |
remove(Locator component)
Removes a service component from the presentation.
|
void |
removeMediaSelectListener(MediaSelectListener listener)
Unsubscribes the specifed
MediaSelectListener from
receiving events related to media selection on this Player. |
void |
replace(Locator fromComponent,
Locator toComponent)
Replaces a service component in the presentation.
|
void |
select(Locator component)
Selects a new service component for presentation.
|
void |
select(Locator[] components)
Selects one or more service components for presentation.
|
public MediaSelectControlImpl(Handler handler, ServiceContextImpl context)
player - The player associated with the media select control.public void select(Locator component) throws InvalidLocatorException, InvalidServiceComponentException, InsufficientResourcesException, SecurityException
Player.select in interface MediaSelectControlcomponent - A locator representing an individual service
component to present.InvalidLocatorException - If the locator does not reference
a selectable service component, or references a service component
that is not part of the Service to which the
MediaSelectControlImpl is restricted.InsufficientResourcesException - If the operation cannot be
completed due to a lack of system resources.SecurityException - If the caller does not have
MediaSelectPermission(component) permission.InvalidServiceComponentException - If the specified
service component is not part of the Service to
which the MediaSelectControl is restricted, or if
it cannot be presented alone.public void select(Locator[] components) throws InvalidLocatorException, InvalidServiceComponentException, InsufficientResourcesException, SecurityException
select in interface MediaSelectControlcomponents - An array of locators representing a set of
individual service components to present together.InvalidLocatorException - If a locator provided does not
reference a selectable service component or references a
service component that is not part of the Service
to which the MediaSelectControlImpl is restricted .InvalidServiceComponentException - If the specified set
of service components cannot be presented as a coherent whole or
if the service components are not all available simultaneously.InsufficientResourcesException - If the operation cannot be
completed due to a lack of system resources.SecurityException - If the caller does not have
MediaSelectPermission(components[i]) permission
for any valid i.public void add(Locator component) throws InvalidLocatorException, InvalidServiceComponentException, InsufficientResourcesException, SecurityException
add in interface MediaSelectControlcomponent - The locator representing an individual service
component to add to the presentation.InvalidLocatorException - If the specified locator does
not reference a selectable service component, references a
service component whose addition would require
resynchronization of the Player, or references a service
component that is not part of the Service to which
the MediaSelectControlImpl is restricted.InsufficientResourcesException - If the operation cannot be
completed due to a lack of system resources.SecurityException - If the caller does not have
MediaSelectPermission(component) permission.InvalidServiceComponentException - If the addition of the
service component would require resynchronization of the
Player, If the specified service component is not part of the Service or Services to which the MediaSelectControl is
restricted, or if the service
component must be presented in conjunction with another service
component that is not part of the current presentation.public void remove(Locator component) throws InvalidLocatorException, InvalidServiceComponentException, SecurityException
remove in interface MediaSelectControlcomponent - The locator representing an individual service
component to remove from the presentation.InvalidLocatorException - If the specified locator does
not reference a service component in the current selection,
references a service component whose addition would require
resynchronization of the Player, or references a service
component that is not part of the Service to which
the MediaSelectControlImpl is restricted.SecurityException - If the caller does not have
MediaSelectPermission(component) permission.InvalidServiceComponentException - If removal of the
specified service component would require resynchronization of
the Player, or if another service component in
the current presentation must be presented in conjunction with
component.public void replace(Locator fromComponent, Locator toComponent) throws InvalidLocatorException, InvalidServiceComponentException, InsufficientResourcesException, SecurityException
MediaSelectControlMediaSelectEvent. Components whose replacement
would require Player resynchronization are not permitted.replace in interface MediaSelectControlfromComponent - The locator that represents the service
component to remove from the presentation.toComponent - The locator that represents the service
component to add to the presentation.InvalidLocatorException - If fromComponent
does not reference a service component in the current
selection, or if toComponent does not reference a
selectable service component.InvalidServiceComponentException - If
toComponent references a service component that is
not part of the Service to which the
MediaSelectControl is restricted, if
fromComponent or toComponent reference
service components for which this operation would require
resynchronization of the Player, if another service
component in the current presentation must be presented in
conjunction with fromComponent, or if
toComponent must be presented in conjunction with a
service component not in the resulting presentation.InsufficientResourcesException - If the operation cannot be
completed due to a lack of system resources.SecurityException - If the caller does not have
MediaSelectPermission(fromComponent) and
MediaSelectPermission(toComponent) permission.public void addMediaSelectListener(MediaSelectListener listener)
MediaSelectListener to
receive events related to media selection on this Player.addMediaSelectListener in interface MediaSelectControllistener - The MediaSelectListener to which
to send events.public void removeMediaSelectListener(MediaSelectListener listener)
MediaSelectListener from
receiving events related to media selection on this Player.removeMediaSelectListener in interface MediaSelectControllistener - The MediaSelectListener to unsubscribe.public Locator[] getCurrentSelection()
getCurrentSelection in interface MediaSelectControlpublic Component getControlComponent()
Component associated with this
Control object.
For example, this method might return
a slider for volume control or a panel containing radio buttons for
CODEC control.
The getControlComponent method can return
null if there is no GUI control for
this Control.getControlComponent in interface Controlpublic void receiveServiceContextEvent(ServiceContextEvent e)
ServiceContextListenerServiceContextListener of an event
generated by a ServiceContext.receiveServiceContextEvent in interface ServiceContextListenere - The generated event.Copyright © 2012 code4tv.com. All Rights Reserved.