Search in sources :

Example 6 with PlayerView

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;
}
Also used : PlayerView(com.google.android.exoplayer2.ui.PlayerView) PlayerView(com.google.android.exoplayer2.ui.PlayerView) RecyclerView(androidx.recyclerview.widget.RecyclerView) ListView(android.widget.ListView) NavigationBarView(com.google.android.material.navigation.NavigationBarView) ImageView(android.widget.ImageView) View(android.view.View) WebView(android.webkit.WebView) BottomNavigationView(com.google.android.material.bottomnavigation.BottomNavigationView) TextView(android.widget.TextView)

Example 7 with PlayerView

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);
    }
}
Also used : PlayerView(com.google.android.exoplayer2.ui.PlayerView) TextView(android.widget.TextView)

Example 8 with PlayerView

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));
        }
    }
}
Also used : PlayerView(com.google.android.exoplayer2.ui.PlayerView) TextView(android.widget.TextView)

Example 9 with PlayerView

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);
    }
}
Also used : PlayerView(com.google.android.exoplayer2.ui.PlayerView) SolidIconView(com.odysee.app.ui.controls.SolidIconView) PlayerView(com.google.android.exoplayer2.ui.PlayerView) NestedScrollView(androidx.core.widget.NestedScrollView) AdapterView(android.widget.AdapterView) RecyclerView(androidx.recyclerview.widget.RecyclerView) PhotoView(com.github.chrisbanes.photoview.PhotoView) ImageView(android.widget.ImageView) View(android.view.View) WebView(android.webkit.WebView) TextView(android.widget.TextView)

Example 10 with PlayerView

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);
}
Also used : AttributeProviderContext(org.commonmark.renderer.html.AttributeProviderContext) Context(android.content.Context) PlayerView(com.google.android.exoplayer2.ui.PlayerView) MainActivity(com.odysee.app.MainActivity) SolidIconView(com.odysee.app.ui.controls.SolidIconView) PlayerView(com.google.android.exoplayer2.ui.PlayerView) NestedScrollView(androidx.core.widget.NestedScrollView) AdapterView(android.widget.AdapterView) RecyclerView(androidx.recyclerview.widget.RecyclerView) PhotoView(com.github.chrisbanes.photoview.PhotoView) ImageView(android.widget.ImageView) View(android.view.View) WebView(android.webkit.WebView) TextView(android.widget.TextView) Claim(com.odysee.app.model.Claim) TrackSelectionOverride(com.google.android.exoplayer2.trackselection.TrackSelectionOverrides.TrackSelectionOverride)

Aggregations

PlayerView (com.google.android.exoplayer2.ui.PlayerView)25 TextView (android.widget.TextView)20 View (android.view.View)15 ImageView (android.widget.ImageView)14 RecyclerView (androidx.recyclerview.widget.RecyclerView)13 WebView (android.webkit.WebView)12 Uri (android.net.Uri)10 AdapterView (android.widget.AdapterView)10 NestedScrollView (androidx.core.widget.NestedScrollView)10 PhotoView (com.github.chrisbanes.photoview.PhotoView)10 SolidIconView (com.odysee.app.ui.controls.SolidIconView)10 MediaItem (com.google.android.exoplayer2.MediaItem)8 Context (android.content.Context)7 Nullable (androidx.annotation.Nullable)7 Player (com.google.android.exoplayer2.Player)7 MediaSource (com.google.android.exoplayer2.source.MediaSource)7 ProgressiveMediaSource (com.google.android.exoplayer2.source.ProgressiveMediaSource)7 SuppressLint (android.annotation.SuppressLint)6 Intent (android.content.Intent)6 SimpleExoPlayer (com.google.android.exoplayer2.SimpleExoPlayer)6