mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Minor guide cleanup for 2.14
#minor-release PiperOrigin-RevId: 372980349
This commit is contained in:
parent
763ef2b911
commit
9a2ebbb72e
@ -98,12 +98,9 @@ to prevent build errors.
|
|||||||
|
|
||||||
## Creating the player ##
|
## Creating the player ##
|
||||||
|
|
||||||
You can create an `ExoPlayer` instance using `SimpleExoPlayer.Builder` or
|
You can create an `ExoPlayer` instance using `SimpleExoPlayer.Builder`, which
|
||||||
`ExoPlayer.Builder`. The builders provide a range of customization options for
|
provides a range of customization options. The code below is the simplest
|
||||||
creating `ExoPlayer` instances. For the vast majority of use cases
|
example of creating an instance.
|
||||||
`SimpleExoPlayer.Builder` should be used. This builder returns
|
|
||||||
`SimpleExoPlayer`, which extends `ExoPlayer` to add additional high level player
|
|
||||||
functionality. The code below is an example of creating a `SimpleExoPlayer`.
|
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build();
|
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build();
|
||||||
@ -224,9 +221,9 @@ on the player. Some of the most commonly used methods are listed below.
|
|||||||
* `setShuffleModeEnabled` controls playlist shuffling.
|
* `setShuffleModeEnabled` controls playlist shuffling.
|
||||||
* `setPlaybackParameters` adjusts playback speed and audio pitch.
|
* `setPlaybackParameters` adjusts playback speed and audio pitch.
|
||||||
|
|
||||||
If the player is bound to a `PlayerView` or `PlayerControlView`, then user
|
If the player is bound to a `StyledPlayerView` or `StyledPlayerControlView`,
|
||||||
interaction with these components will cause corresponding methods on the player
|
then user interaction with these components will cause corresponding methods on
|
||||||
to be invoked.
|
the player to be invoked.
|
||||||
|
|
||||||
## Releasing the player ##
|
## Releasing the player ##
|
||||||
|
|
||||||
|
@ -177,19 +177,12 @@ generic `onEvents` callback, for example to record media item change reasons
|
|||||||
with `onMediaItemTransition`, but only act once all state changes can be used
|
with `onMediaItemTransition`, but only act once all state changes can be used
|
||||||
together in `onEvents`.
|
together in `onEvents`.
|
||||||
|
|
||||||
## SimpleExoPlayer listeners ##
|
## Using AnalyticsListener ##
|
||||||
|
|
||||||
When using `SimpleExoPlayer`, an additional listener can be registered with the
|
When using `SimpleExoPlayer`, an `AnalyticsListener` can be registered with the
|
||||||
player.
|
player by calling `addAnalyticsListener`. `AnalyticsListener` implementations
|
||||||
|
are able to listen to detailed events that may be useful for analytics and
|
||||||
* `addAnalyticsListener`: Listen to detailed events that may be useful for
|
logging purposes. Please refer to the [analytics page][] for more details.
|
||||||
analytics and logging purposes. Please refer to the [analytics page][] for
|
|
||||||
more details.
|
|
||||||
|
|
||||||
ExoPlayer's UI components, such as `StyledPlayerView`, will register themselves
|
|
||||||
as listeners to events that they are interested in. Hence manual registration
|
|
||||||
using the methods above is only useful for applications that implement their own
|
|
||||||
player UI, or need to listen to events for some other purpose.
|
|
||||||
|
|
||||||
### Using EventLogger ###
|
### Using EventLogger ###
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user