public class Casty
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Casty.OnCastSessionUpdatedListener |
static interface |
Casty.OnConnectChangeListener |
| Modifier and Type | Method and Description |
|---|---|
void |
addMediaRouteMenuItem(android.view.Menu menu)
Adds the discovery menu item on a toolbar and creates Introduction Overlay
Should be used in
Activity.onCreateOptionsMenu(Menu). |
void |
addMiniController()
Adds the Mini Controller at the bottom of Activity's layout
Must be run on UiThread.
|
static void |
configure(com.google.android.gms.cast.framework.CastOptions castOptions)
Sets the custom CastOptions, should be used in the
Application class. |
static void |
configure(java.lang.String receiverId)
Sets the custom receiver ID.
|
static Casty |
create(android.app.Activity activity)
Creates the Casty object.
|
void |
disconnectChromecast() |
CastyPlayer |
getPlayer()
Gives access to
CastyPlayer, which allows to control the media files. |
double |
getVolume() |
boolean |
isConnected()
Checks if a Google Cast device is connected.
|
void |
onMediaLoaded() |
void |
setOnCastSessionUpdatedListener(Casty.OnCastSessionUpdatedListener onCastSessionUpdatedListener)
|
void |
setOnConnectChangeListener(Casty.OnConnectChangeListener onConnectChangeListener)
|
void |
setUpMediaRouteButton(android.support.v7.app.MediaRouteButton mediaRouteButton)
Makes
MediaRouteButton react to discovery events. |
void |
setVolume(double volume) |
boolean |
toggleMuteVolume() |
void |
turnOnVolume() |
Casty |
withMiniController()
Adds the Mini Controller at the bottom of Activity's layout.
|
public static void configure(@NonNull
java.lang.String receiverId)
Application class.receiverId - the custom receiver ID, e.g. Styled Media Receiver - with custom logo and backgroundpublic static void configure(@NonNull
com.google.android.gms.cast.framework.CastOptions castOptions)
Application class.castOptions - the custom CastOptions object, must include a receiver IDpublic static Casty create(@NonNull android.app.Activity activity)
activity - Activity in which Casty object is createdpublic CastyPlayer getPlayer()
CastyPlayer, which allows to control the media files.CastyPlayerpublic boolean isConnected()
@UiThread
public void addMediaRouteMenuItem(@NonNull
android.view.Menu menu)
Activity.onCreateOptionsMenu(Menu).menu - Menu in which MenuItem should be added@UiThread
public void setUpMediaRouteButton(@NonNull
android.support.v7.app.MediaRouteButton mediaRouteButton)
MediaRouteButton react to discovery events.
Must be run on UiThread.mediaRouteButton - Button to be set up@UiThread public Casty withMiniController()
@UiThread public void addMiniController()
public void setOnConnectChangeListener(@Nullable
Casty.OnConnectChangeListener onConnectChangeListener)
onConnectChangeListener - Connect change uzLivestreamCallbackpublic void setOnCastSessionUpdatedListener(@Nullable
Casty.OnCastSessionUpdatedListener onCastSessionUpdatedListener)
onCastSessionUpdatedListener - Cast session updated uzLivestreamCallbackpublic double getVolume()
public void setVolume(double volume)
public void turnOnVolume()
public boolean toggleMuteVolume()
public void onMediaLoaded()
public void disconnectChromecast()