DoubleTapPlayerView
DoubleTapPlayerView copied to clipboard
Don’t work double tap
I try code from guide and add in Java this
YouTubeOverlay youTubeOverlay = getView().findViewById(R.id.youtube_overlay);
youTubeOverlay.performListener(new YouTubeOverlay.PerformListener() {
@Override
public void onAnimationStart() {
youTubeOverlay.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd() {
youTubeOverlay.setVisibility(View.GONE);
}
});
XML:
<com.keeppixel.kompot.CustomPlayerView
android:id="@+id/videoView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_timeout="0"
app:hide_on_touch="true"
app:player_layout_id="@layout/playerview"
android:animateLayoutChanges="true"
app:controller_layout_id="@layout/contollervidfull"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:dtpv_controller="@+id/youtube_overlay" />
<com.github.vkay94.dtpv.youtube.YouTubeOverlay
android:id="@+id/youtube_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible"
app:layout_constraintTop_toTopOf="@id/videoView2"
app:layout_constraintBottom_toBottomOf="@id/videoView2"
app:layout_constraintStart_toStartOf="@id/videoView2"
app:layout_constraintEnd_toEndOf="@id/videoView2"
app:yt_playerView="@+id/videoView2" />
But double top don’t work.
Seems like you forgot something: https://github.com/vkay94/DoubleTapPlayerView#getting-started
// Uncomment this line if you haven't set yt_playerView in XML
youtube_overlay.playerView(playerView)
// Uncomment this line if you haven't set dtpv_controller in XML
// playerView.controller(youtube_overlay)
// Call this method whenever the player is released and recreated
youtube_overlay.player(simpleExoPlayer)
Unfortunately, this don't work. I try use code from ready project