|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines methods for playing media data into a Terminal. A Player extracts data from a media data object (MDO) (which supplies a stream of media to be played), transcodes the data as necessary for the telephony network, and streams the resultant data out to that network.
The play() method accepts one or an array of Strings which identify the media streams to be played. Each media stream may be encoded by any coder type supported by this player resource.
A Player may optionally support additional processing features. These features define parameters and runtime controls that affect operation of an ongoing play operation. The presence of these features is indicated by a true value for the following attributes:
Attribute: | indicates the ability to: |
a_Pause | pause and resume in place |
a_Speed | change the playback speed |
a_Volume | increase and decrease the volume |
a_Jump | jump forward and backward while playing |
In addition to the play() method, a number of RTC actions
may affect the operation of the player. These can be invoked through
Run Time Control RTC
actions, or by the
pausePlayer(), resumePlayer(), stopPlayer()
jumpPlayer(), adjustPlayerVolume(), adjustPlayerSpeed()
methods.
Coding types for data objects are defined in CoderConstants
.
The MDO to be played is identified by its String name. The String name is an identifier that may be interpreted as a path or URL (URI) for the MDO.
Note: The format of the String that identifies an MDO is not defined by this release of specification [although it will be compatible with that used in the ContainerService]. The vendor-specific implementation of the MediaService (for example, the vendor of the server or resource) shall define the supported String formats.
For example, an implementation may support URLs or File pathnames; in which case an application could use Strings of the form: "file://node/dir/name" or "dir/dir/name" or "container/container/dataobject".
If the MDO identifier is a file pathname, it is interpreted in the logical filename-space of the server. Applications and their prompts need to be installed with correct pathnames.
The Player has three states: Idle, Active, and Paused.
In the Idle state, the Player is performing no coding or transmit operations. The state transitions to the Active or Paused state when the play() method starts. The state of the Player after play() starts is determined by the Boolean value of the parameter p_StartPaused. The state transitions to Active if p_StartPaused is false. The state transitions to Paused if p_StartPaused is true.
In the Paused state, the player is not transmitting the media stream. It retains its place in the MDO being played, and resumes from the same place when the RTC action, rtca_Resume is received.
In the Active state, the Player is busy, actively transmitting the media stream from a MDO to its output media stream (the Terminal). The Player continues in this state until it reaches the end of the MDO list or until RTC actions tell it to pause or stop. In the Active state, the Player may receive RTC commands to change the speed or volume of the play operation. It may also receive commands to jump forward or backward in the MDO.
If a new play() is attempted while the Player is Active, the result is determined by the value of the p_IfBusy parameter. The alternative values for p_IfBusy are:
onPause
is invoked if ev_Pause
is enabled in p_EnabledEvents.onResume
is invoked if ev_Resume
is enabled in p_EnabledEvents.The units by which speed may be adjusted are percentage change from the normal speed.
If the attribute Player.a_Speed is true, then the player supports the following features:
The units by which volume may be adjusted are measured in dB from the normal volume.
If the value of attribute a_Volume is true then the Player supports the following features:
If the value of attribute a_Volume is false, then the effects of the RTC actions, parameters, and methods discussed in this section are not defined.
If a player resource supports a_Jump attribute, then the following features are supported:
A Jump method or RTC action that goes past the end of the current MDO continues into the next MDO in the MDO list if the coders for the MDOs support the same time increment. If the next MDO in sequence has a different coder type, the current location is set to the beginning of that MDO.
If the value of attribute a_Jump is false, then the effects of the RTC actions, parameters, and methods discussed in this section are not defined.
Fields inherited from interface javax.telephony.media.ResourceConstants |
e_Disconnected, FOREVER, q_Disconnected, q_RTC, rtcc_Disconnected, rtcc_TriggerRTC, v_Forever |
Fields inherited from interface javax.telephony.media.MediaConstants |
e_OK, q_Duration, q_Standard, q_Stop |
Fields inherited from interface javax.telephony.media.CoderConstants |
v_24kADPCM, v_32kADPCM, v_44kADPCM, v_48k8BitLinear, v_48kALawPCM, v_48kMuLawPCM, v_64k8BitLinear, v_64kALawPCM, v_64kMuLawPCM, v_88k8BitLinear, v_88kALawPCM, v_88kMuLawPCM, v_ADPCM_24k, v_ADPCM_32k, v_ADPCM_44k, v_ADSI, v_ALawPCM_48k, v_ALawPCM_64k, v_ALawPCM_88k, v_ASCII, v_Linear8Bit_48k, v_Linear8Bit_64k, v_Linear8Bit_88k, v_MuLawPCM_48k, v_MuLawPCM_64k, v_MuLawPCM_88k, v_TDD |
Method Summary | |
PlayerEvent |
adjustPlayerSpeed(Symbol adjustment)
Adjusts the speed of the current play function. |
PlayerEvent |
adjustPlayerVolume(Symbol adjustment)
Adjusts the volume the current play function. |
PlayerEvent |
jumpPlayer(Symbol jump)
Jump forward or backward within a sequence of MDOs during a play. |
PlayerEvent |
pausePlayer()
Pause the current play. |
PlayerEvent |
play(java.lang.String[] streamIDs,
int offset,
RTC[] rtc,
java.util.Dictionary optargs)
Play a sequence of MDOs (Media Data Objects) identified by the streamIDs. |
PlayerEvent |
play(java.lang.String streamID,
int offset,
RTC[] rtc,
java.util.Dictionary optargs)
Play a single MDO (Media Data Object) named by streamID. |
PlayerEvent |
resumePlayer()
Resume the current play. |
PlayerEvent |
stopPlayer()
Stop the current play. |
Method Detail |
public PlayerEvent play(java.lang.String[] streamIDs, int offset, RTC[] rtc, java.util.Dictionary optargs) throws MediaResourceException
This method returns when the MDO list is completely played, or when the playing has been stopped. (Player Pause does not cause this method to return.) Play returns a PlayerEvent. The condition that caused the play to stop is included in the completion event. RTC actions can alter the course of the play without the intervention of the application. Optional arguments can alter the characteristics of the play.
Exceptions are thrown if pre- or post- conditions are not satisfied
Pre-conditions:
Post-conditions:
streamIDs
- a String[] naming the MDO list to be played.offset
- number of milliseconds into the MDO list at
which play is to start, offset may span several items in streamIDs.rtc
- Array of RTC that effect this play.optargs
- a Dictionary of optional arguments.MediaResourceException
- if requested operation fails.DisconnectedException
- if Terminal is disconnected.public PlayerEvent play(java.lang.String streamID, int offset, RTC[] rtc, java.util.Dictionary optargs) throws MediaResourceException
streamID
- a String naming the MDO to be played.offset
- int number milliseconds into the MDO
at which play is to start.rtc
- Array of RTC that effect this play.optargs
- a Dictionary of optional arguments.MediaResourceException
- if requested operation fails.DisconnectedException
- if Terminal is disconnected.public PlayerEvent adjustPlayerSpeed(Symbol adjustment) throws MediaResourceException
Parameter adjustment specifies the type of speed adjustment desired.
This is functionally equivalent to the RTC actions.
Note: the value of p_SpeedChange is in units of percent deviation from normal.
Note: this is functionally equivalent to the RTC actions, except that it generates a Completion Event instead of a non-transactional Event.
adjustment
- an RTC Symbol specifying the type of change.MediaResourceException
- if speed cannot be adjustedpublic PlayerEvent adjustPlayerVolume(Symbol adjustment) throws MediaResourceException
Parameter adjustment specifies the type of volume adjustment desired.
This is functionally equivalent to the RTC actions.
Note: the value of p_VolumeChange in in units of dB from the normal volume.
Note: this is functionally equivalent to the RTC actions, except that it generates a Completion Event instead of a non-transactional Event.
adjustment
- an RTC Symbol specifying the type of change.MediaResourceException
- if volume cannot be adjustedpublic PlayerEvent jumpPlayer(Symbol jump) throws MediaResourceException
Parameter jump specifies the type of jump desired. It is one of the rtca_Jump<Type><Units> Symbols.
For example: rtca_JumpForwardTime.
This is functionally equivalent to the Jump RTC actions, except that it generates a Completion Event instead of a non-transactional Event.
jump
- a Symbol specifying the type of jump.MediaResourceException
- if the jump cannot be donepublic PlayerEvent pausePlayer() throws MediaResourceException
This is functionally equivalent to rtca_Pause, except that it generates a Completion Event instead of a non-transactional Event.
MediaResourceException
- if pause cannot be donepublic PlayerEvent resumePlayer() throws MediaResourceException
This is functionally equivalent to rtca_Resume, except that it generates a Completion Event instead of a non-transactional Event.
MediaResourceException
- if resume cannot be donepublic PlayerEvent stopPlayer() throws MediaResourceException
This is functionally equivalent to rtca_Stop, except that it generates a Completion Event instead of a non-transactional Event.
MediaResourceException
- if stop cannot be done
|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |