Commit d5ae16c0 by christosts Committed by tonihei

Extend documentation for ForwardingPlayer

Add some additional information which methods to override
for available commands.

#minor-release

PiperOrigin-RevId: 513251805
(cherry picked from commit a64a9e67)
parent d3ef8010
Showing with 14 additions and 8 deletions
...@@ -225,14 +225,20 @@ the following: ...@@ -225,14 +225,20 @@ the following:
When overriding `ForwardingPlayer` methods it's important to ensure the When overriding `ForwardingPlayer` methods it's important to ensure the
implementation remains self-consistent and compliant with the `Player` implementation remains self-consistent and compliant with the `Player`
interface, especially when dealing with methods that are intended to have interface, especially when dealing with methods that are intended to have
identical or related behavior. For example, if you want to override every 'play' identical or related behavior. For example:
operation, you need to override both `ForwardingPlayer.play` and * If you want to override every 'play' operation, you need to override both
`ForwardingPlayer.setPlayWhenReady`, because a caller will expect the behavior `ForwardingPlayer.play` and `ForwardingPlayer.setPlayWhenReady`, because a
of these methdods to be identical when `playWhenReady = true`. Similarly, if you caller will expect the behavior of these methods to be identical when
want to change the seek-forward increment you need to override both `playWhenReady = true`.
`ForwardingPlayer.seekForward` to perform a seek with your customized increment, * If you want to change the seek-forward increment you need to override both
and `ForwardingPlayer.getSeekForwardIncrement` in order to report the correct `ForwardingPlayer.seekForward` to perform a seek with your customized
customized increment back to the caller. increment, and `ForwardingPlayer.getSeekForwardIncrement` in order to report
the correct customized increment back to the caller.
* If you want to control what `Player.Commands` are advertised by a player
instance, you must override `Player.getAvailableCommands()`,
`Player.isCommandAvailable()` and also listen to the
`Player.Listener.onAvailableCommandsChanged()` callback to get notified of
changes coming from the underlying player.
## MediaSource customization ## ## MediaSource customization ##
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment