TransferCallback
abstract class TransferCallback
kotlin.Any | |
↳ | android.media.MediaRouter2.TransferCallback |
Callback for receiving events on media transfer.
Summary
Public constructors | |
---|---|
Public methods | |
---|---|
open Unit |
onStop(controller: MediaRouter2.RoutingController) Called when a media routing stops. |
open Unit |
onTransfer(oldController: MediaRouter2.RoutingController, newController: MediaRouter2.RoutingController) Called when a media is transferred between two different routing controllers. |
open Unit |
onTransferFailure(requestedRoute: MediaRoute2Info) Called when |
Public constructors
TransferCallback
TransferCallback()
Public methods
onStop
open fun onStop(controller: MediaRouter2.RoutingController): Unit
Called when a media routing stops. It can be stopped by a user or a provider. App should not continue playing media locally when this method is called. The controller
is released before this method is called.
Parameters | |
---|---|
controller |
MediaRouter2.RoutingController: the controller that controlled the stopped media routing This value cannot be null . |
onTransfer
open fun onTransfer(
oldController: MediaRouter2.RoutingController,
newController: MediaRouter2.RoutingController
): Unit
Called when a media is transferred between two different routing controllers. This can happen by calling transferTo(android.media.MediaRoute2Info)
.
Override this to start playback with newController
. You may want to get the status of the media that is being played with oldController
and resume it continuously with newController
. After this is called, any callbacks with oldController
will not be invoked unless oldController
is the system controller
. You need to release
oldController
before playing the media with newController
.
Parameters | |
---|---|
oldController |
MediaRouter2.RoutingController: the previous controller that controlled routing This value cannot be null . |
newController |
MediaRouter2.RoutingController: the new controller to control routing This value cannot be null . |
See Also
onTransferFailure
open fun onTransferFailure(requestedRoute: MediaRoute2Info): Unit
Called when transferTo(android.media.MediaRoute2Info)
failed.
Parameters | |
---|---|
requestedRoute |
MediaRoute2Info: the route info which was used for the transfer This value cannot be null . |