have external player fragment show play button if casting

This commit is contained in:
Domingos Lopes 2016-04-17 02:44:42 -04:00
parent a77c77724b
commit 450329a5e3
2 changed files with 4 additions and 5 deletions

View File

@ -172,8 +172,7 @@ public class ExternalPlayerFragment extends Fragment {
.into(imgvCover); .into(imgvCover);
fragmentLayout.setVisibility(View.VISIBLE); fragmentLayout.setVisibility(View.VISIBLE);
// TODO change this to show play button if connected to chromecast if (controller.isPlayingVideoLocally()) {
if (controller.isPlayingVideo()) {
butPlay.setVisibility(View.GONE); butPlay.setVisibility(View.GONE);
} else { } else {
butPlay.setVisibility(View.VISIBLE); butPlay.setVisibility(View.VISIBLE);

View File

@ -715,9 +715,9 @@ public abstract class PlaybackController {
} }
} }
// TODO this method probably needs to change public boolean isPlayingVideoLocally() {
public boolean isPlayingVideo() { return playbackService != null && PlaybackService.getCurrentMediaType() == MediaType.VIDEO
return playbackService != null && PlaybackService.getCurrentMediaType() == MediaType.VIDEO; && !PlaybackService.isCasting();
} }
public Pair<Integer, Integer> getVideoSize() { public Pair<Integer, Integer> getVideoSize() {