android edittext hit,MediaController.TransportControls

MediaController.TransportControls

public

final

class

MediaController.TransportControls

extends Object↳

android.media.session.MediaController.TransportControls

Interface for controlling media playback on a session. This allows an app

to send media transport commands to the session.

Summary

Public methods

void

Start fast forwarding.

void

Request that the player pause its playback and stay at its current

position.

void

Request that the player start its playback at its current position.

void

Request that the player start playback for a specific media id.

void

Request that the player start playback for a specific search query.

void

Request that the player start playback for a specific

void

Request that the player prepare its playback.

void

Request that the player prepare playback for a specific media id.

void

Request that the player prepare playback for a specific search query.

void

Request that the player prepare playback for a specific

void

Start rewinding.

void

seekTo(long pos)

Move to a new location in the media stream.

void

Send a custom action back for the

void

Send the id and args from a custom action back for the

void

Sets the playback speed.

void

Rate the current content.

void

Skip to the next item.

void

Skip to the previous item.

void

Play an item with a specific id in the play queue.

void

Request that the player stop its playback; it may clear its state in

whatever way is appropriate.

Inherited methods

Creates and returns a copy of this object.

boolean

Indicates whether some other object is "equal to" this one.

void

Called by the garbage collector on an object when garbage collection

determines that there are no more references to the object.

final

Class>

Returns the runtime class of this Object.

int

Returns a hash code value for the object.

final

void

Wakes up a single thread that is waiting on this object's

monitor.

final

void

Wakes up all threads that are waiting on this object's monitor.

Returns a string representation of the object.

final

void

wait(long timeout, int nanos)

Causes the current thread to wait until another thread invokes the

final

void

wait(long timeout)

Causes the current thread to wait until either another thread invokes the

final

void

Causes the current thread to wait until another thread invokes the

Public methods

fastForward

public void fastForward ()

Start fast forwarding. If playback is already fast forwarding this

may increase the rate.

pause

public void pause ()

Request that the player pause its playback and stay at its current

position.

play

public void play ()

Request that the player start its playback at its current position.

playFromMediaId

public void playFromMediaId (String mediaId,

Bundle extras)

Request that the player start playback for a specific media id.

Parameters

mediaId

String: The id of the requested media.

extras

Bundle: Optional extras that can include extra information about the media item

to be played.

playFromSearch

public void playFromSearch (String query,

Bundle extras)

Request that the player start playback for a specific search query.

An empty or null query should be treated as a request to play any

music.

Parameters

query

String: The search query.

extras

Bundle: Optional extras that can include extra information

about the query.

playFromUri

public void playFromUri (Uri uri,

Bundle extras)

Request that the player start playback for a specific

Parameters

uri

Uri: The URI of the requested media.

extras

Bundle: Optional extras that can include extra information about the media item

to be played.

prepare

public void prepare ()

Request that the player prepare its playback. In other words, other sessions can continue

to play during the preparation of this session. This method can be used to speed up the

start of the playback. Once the preparation is done, the session will change its playback

state to

prepareFromMediaId

public void prepareFromMediaId (String mediaId,

Bundle extras)

Request that the player prepare playback for a specific media id. In other words, other

sessions can continue to play during the preparation of this session. This method can be

used to speed up the start of the playback. Once the preparation is done, the session

will change its playback state to

Parameters

mediaId

String: The id of the requested media.

extras

Bundle: Optional extras that can include extra information about the media item

to be prepared.

prepareFromSearch

public void prepareFromSearch (String query,

Bundle extras)

Request that the player prepare playback for a specific search query. An empty or null

query should be treated as a request to prepare any music. In other words, other sessions

can continue to play during the preparation of this session. This method can be used to

speed up the start of the playback. Once the preparation is done, the session will

change its playback state to

Parameters

query

String: The search query.

extras

Bundle: Optional extras that can include extra information

about the query.

prepareFromUri

public void prepareFromUri (Uri uri,

Bundle extras)

Request that the player prepare playback for a specific

Parameters

uri

Uri: The URI of the requested media.

extras

Bundle: Optional extras that can include extra information about the media item

to be prepared.

rewind

public void rewind ()

Start rewinding. If playback is already rewinding this may increase

the rate.

seekTo

public void seekTo (long pos)

Move to a new location in the media stream.

Parameters

pos

long: Position to move to, in milliseconds.

sendCustomAction

public void sendCustomAction (PlaybackState.CustomAction customAction,

Bundle args)

Send a custom action back for the

Parameters

customAction

PlaybackState.CustomAction: The action to perform.

This value cannot be null.

args

Bundle: Optional arguments to supply to the null.

sendCustomAction

public void sendCustomAction (String action,

Bundle args)

Send the id and args from a custom action back for the

Parameters

action

String: The action identifier of the null.

args

Bundle: Optional arguments to supply to the null.

setPlaybackSpeed

public void setPlaybackSpeed (float speed)

Sets the playback speed. A value of 1.0f is the default playback value,

and a negative value indicates reverse playback. 0.0f is not allowed.

Parameters

speed

float: The playback speed

Throws

if the speed is equal to zero.

setRating

public void setRating (Rating rating)

Rate the current content. This will cause the rating to be set for

the current user. The Rating type must match the type returned by

Parameters

rating

Rating: The rating to set for the current content

skipToNext

public void skipToNext ()

Skip to the next item.

skipToPrevious

public void skipToPrevious ()

Skip to the previous item.

skipToQueueItem

public void skipToQueueItem (long id)

Play an item with a specific id in the play queue. If you specify an

id that is not in the play queue, the behavior is undefined.

Parameters

id

long

stop

public void stop ()

Request that the player stop its playback; it may clear its state in

whatever way is appropriate.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值