Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupMenu;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
Expand Down Expand Up @@ -86,6 +87,7 @@
import org.schabi.newpipe.util.ListHelper;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PermissionHelper;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.ShareUtils;
import org.schabi.newpipe.util.StateSaver;
import org.schabi.newpipe.util.ThemeHelper;
Expand Down Expand Up @@ -517,6 +519,7 @@ public void onPlaybackParameterChanged(final float playbackTempo, final float pl
private class VideoPlayerImpl extends VideoPlayer {
private static final float MAX_GESTURE_LENGTH = 0.75f;

private LinearLayout metadata;
private TextView titleTextView;
private TextView channelTextView;
private RelativeLayout volumeRelativeLayout;
Expand Down Expand Up @@ -561,6 +564,7 @@ private class VideoPlayerImpl extends VideoPlayer {
@Override
public void initViews(final View view) {
super.initViews(view);
this.metadata = view.findViewById(R.id.metadataView);
this.titleTextView = view.findViewById(R.id.titleTextView);
this.channelTextView = view.findViewById(R.id.channelTextView);
this.volumeRelativeLayout = view.findViewById(R.id.volumeRelativeLayout);
Expand Down Expand Up @@ -619,6 +623,7 @@ public void initListeners() {
gestureDetector.setIsLongpressEnabled(false);
getRootView().setOnTouchListener(listener);

metadata.setOnClickListener(this);
queueButton.setOnClickListener(this);
repeatButton.setOnClickListener(this);
shuffleButton.setOnClickListener(this);
Expand Down Expand Up @@ -814,6 +819,15 @@ public void onMuteUnmuteButtonClicked() {
setMuteButton(muteButton, playerImpl.isMuted());
}

public void onMetadataClicked() {
NavigationHelper.openVideoDetail(context,
ServiceHelper.getSelectedServiceId(context),
playerImpl.getVideoUrl(), playerImpl.getVideoTitle());

((View) getControlAnimationView().getParent()).setVisibility(View.GONE);
destroy();
finish();
}

@Override
public void onClick(final View v) {
Expand Down Expand Up @@ -850,6 +864,8 @@ public void onClick(final View v) {
return;
} else if (v.getId() == kodiButton.getId()) {
onKodiShare();
} else if (v.getId() == metadata.getId()) {
onMetadataClicked();
}

if (getCurrentState() != STATE_COMPLETED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.schabi.newpipe.player.playqueue.PlayQueueItemTouchCallback;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.ThemeHelper;

import java.util.Collections;
Expand Down Expand Up @@ -485,7 +486,8 @@ public void onClick(final View view) {
} else if (view.getId() == shuffleButton.getId()) {
player.onShuffleClicked();
} else if (view.getId() == metadata.getId()) {
scrollToSelected();
onOpenDetail(ServiceHelper.getSelectedServiceId(getApplicationContext()),
player.getVideoUrl(), player.getVideoTitle());
} else if (view.getId() == progressLiveSync.getId()) {
player.seekToDefault();
}
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/layout-large-land/activity_main_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/qualityTextView"
android:clickable="true"
android:focusable="true"
android:gravity="top"
android:orientation="vertical"
android:paddingLeft="8dp"
Expand All @@ -169,30 +171,32 @@
android:id="@+id/titleTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="15sp"
android:textStyle="bold"
android:clickable="true"
tools:ignore="RtlHardcoded"
tools:text="The Video Title LONG very LONG"/>

<TextView
android:id="@+id/channelTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="12sp"
android:clickable="true"
tools:text="The Video Artist LONG very LONG very Long"/>
</LinearLayout>

Expand Down
8 changes: 5 additions & 3 deletions app/src/main/res/layout/activity_main_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/qualityTextView"
android:clickable="true"
android:focusable="true"
android:gravity="top"
android:orientation="vertical"
android:paddingLeft="8dp"
Expand All @@ -167,6 +169,7 @@
android:id="@+id/titleTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
Expand All @@ -175,23 +178,22 @@
android:textColor="@android:color/white"
android:textSize="15sp"
android:textStyle="bold"
android:clickable="true"
android:focusable="true"
tools:ignore="RtlHardcoded"
tools:text="The Video Title LONG very LONG"/>
tools:text="The Video Title LONG very LONG" />

<TextView
android:id="@+id/channelTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="12sp"
android:clickable="true"
android:focusable="true"
tools:text="The Video Artist LONG very LONG very Long"/>
</LinearLayout>
Expand Down