use of com.google.android.exoplayer2.ui.PlayerView in project odysee-android by OdyseeTeam.
the class MainActivity method renderPictureInPictureMode.
private void renderPictureInPictureMode() {
findViewById(R.id.main_activity_other_fragment).setVisibility(View.GONE);
findViewById(R.id.fragment_container_main_activity).setVisibility(View.GONE);
findViewById(R.id.miniplayer).setVisibility(View.GONE);
findViewById(R.id.appbar).setVisibility(View.GONE);
hideBottomNavigation();
hideNotifications();
hideActionBar();
dismissActiveDialogs();
View pipPlayerContainer = findViewById(R.id.pip_player_container);
PlayerView pipPlayer = findViewById(R.id.pip_player);
pipPlayer.setPlayer(appPlayer);
pipPlayer.setUseController(false);
pipPlayerContainer.setVisibility(View.VISIBLE);
playerReassigned = true;
}
use of com.google.android.exoplayer2.ui.PlayerView in project odysee-android by OdyseeTeam.
the class MainActivity method checkNowPlaying.
public void checkNowPlaying() {
// Don't show the toolbar when returning from the Share Activity
if (getSupportFragmentManager().findFragmentByTag(FILE_VIEW_TAG) == null)
findViewById(R.id.toolbar).setVisibility(View.VISIBLE);
if (nowPlayingClaim != null) {
findViewById(R.id.miniplayer).setVisibility(View.VISIBLE);
((TextView) findViewById(R.id.global_now_playing_title)).setText(nowPlayingClaim.getTitle());
((TextView) findViewById(R.id.global_now_playing_channel_title)).setText(nowPlayingClaim.getPublisherTitle());
}
if (appPlayer != null && !playerReassigned) {
PlayerView playerView = findViewById(R.id.global_now_playing_player_view);
playerView.setPlayer(null);
playerView.setPlayer(appPlayer);
playerView.setUseController(false);
playerReassigned = true;
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
}
use of com.google.android.exoplayer2.ui.PlayerView in project odysee-android by OdyseeTeam.
the class FileViewFragment method updateQualityView.
private void updateQualityView(View root) {
if (root != null) {
PlayerView playerView = root.findViewById(R.id.file_view_exoplayer_view);
TextView textQuality = playerView.findViewById(R.id.player_quality_label);
if (MainActivity.videoQuality == AUTO_QUALITY_ID) {
textQuality.setText(AUTO_QUALITY_STRING);
} else {
textQuality.setText(String.format("%sp", MainActivity.videoQuality));
}
}
}
use of com.google.android.exoplayer2.ui.PlayerView in project odysee-android by OdyseeTeam.
the class FileViewFragment method hideBuffering.
private void hideBuffering() {
View root = getView();
if (root != null) {
root.findViewById(R.id.player_buffering_progress).setVisibility(View.INVISIBLE);
PlayerView playerView = root.findViewById(R.id.file_view_exoplayer_view);
playerView.findViewById(R.id.player_skip_back_10).setVisibility(View.VISIBLE);
playerView.findViewById(R.id.player_skip_forward_10).setVisibility(View.VISIBLE);
}
}
use of com.google.android.exoplayer2.ui.PlayerView in project odysee-android by OdyseeTeam.
the class FileViewFragment method onResume.
/*
public void openClaimUrl(String url) {
resetViewCount();
resetFee();
currentUrl = url;
ClaimCacheKey key = new ClaimCacheKey();
key.setUrl(currentUrl);
Claim oldClaim = claim;
claim = null;
if (Lbry.claimCache.containsKey(key)) {
claim = Lbry.claimCache.get(key);
if (oldClaim != null && oldClaim.getClaimId().equalsIgnoreCase(claim.getClaimId())) {
// same claim
return;
}
} else {
resolveUrl(currentUrl);
}
resetMedia();
onNewClaim(currentUrl);
Helper.setWunderbarValue(currentUrl, getContext());
if (claim != null) {
Helper.saveViewHistory(url, claim);
if (Helper.isClaimBlocked(claim)) {
renderClaimBlocked();
} else {
checkAndLoadRelatedContent();
checkAndLoadComments();
renderClaim();
}
}
}
public void resetMedia() {
View root = getView();
if (root != null) {
PlayerView view = root.findViewById(R.id.file_view_exoplayer_view);
view.setShutterBackgroundColor(Color.BLACK);
root.findViewById(R.id.file_view_exoplayer_container).setVisibility(View.GONE);
}
if (MainActivity.appPlayer != null) {
MainActivity.appPlayer.stop();
}
resetPlayer();
}
*/
@Override
public void onResume() {
super.onResume();
checkParams();
Context context = getContext();
Helper.setWunderbarValue(currentUrl, context);
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (context instanceof MainActivity) {
MainActivity activity = (MainActivity) context;
LbryAnalytics.setCurrentScreen(activity, "File", "File");
activity.updateCurrentDisplayFragment(this);
if (actualClaim != null && actualClaim.isPlayable() && activity.isInFullscreenMode()) {
enableFullScreenMode();
}
activity.findViewById(R.id.appbar).setFitsSystemWindows(false);
activity.refreshChannelCreationRequired(getView());
}
if (MainActivity.appPlayer != null) {
if (MainActivity.playerReassigned) {
setPlayerForPlayerView();
MainActivity.playerReassigned = false;
}
View root = getView();
if (root != null) {
PlayerView playerView = root.findViewById(R.id.file_view_exoplayer_view);
if (playerView.getPlayer() == null) {
playerView.setPlayer(MainActivity.appPlayer);
}
}
updatePlaybackSpeedView(root);
updateQualityView(root);
loadAndScheduleDurations();
}
checkOwnClaim();
fetchChannels();
applyFilterForBlockedChannels(Lbryio.blockedChannels);
}
Aggregations