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);
fragmentLayout.setVisibility(View.VISIBLE);
// TODO change this to show play button if connected to chromecast
if (controller.isPlayingVideo()) {
if (controller.isPlayingVideoLocally()) {
butPlay.setVisibility(View.GONE);
} else {
butPlay.setVisibility(View.VISIBLE);

View File

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