use of com.google.android.gms.cast.MediaInfo in project AntennaPod by AntennaPod.
the class CastManager method getRemoteMediaUrl.
/**
* Returns the url for the media that is currently playing on the remote device. If there is no
* connection, this will return <code>null</code>.
*
* @throws NoConnectionException If no connectivity to the device exists
* @throws TransientNetworkDisconnectionException If framework is still trying to recover from
* a possibly transient loss of network
*/
public String getRemoteMediaUrl() throws TransientNetworkDisconnectionException, NoConnectionException {
checkConnectivity();
if (remoteMediaPlayer != null && remoteMediaPlayer.getMediaInfo() != null) {
MediaInfo info = remoteMediaPlayer.getMediaInfo();
remoteMediaPlayer.getMediaStatus().getPlayerState();
return info.getContentId();
}
throw new NoConnectionException();
}
Aggregations