pedrovgs / DraggablePanel

Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.
Apache License 2.0
2.99k stars 606 forks source link

YouTube video playback stopped due to unauthorized overlay on top of player #110

Open SarthakJoshi opened 7 years ago

SarthakJoshi commented 7 years ago

As soon as the draggble view is minimized, the youtube player is throwing this error:

W/YouTubeAndroidPlayerAPI: YouTube video playback stopped due to unauthorized overlay on top of player. The YouTubePlayerView is not contained inside its ancestor android.widget.FrameLayout{ff4ae6b V.E..... ......I. 0,0-406,228}. The distances between the ancestor's edges and that of the YouTubePlayerView is: left: 0, top: 0, right: -1, bottom: -1 (these should all be positive).

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:draggable_panel="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="#000000">

     <ListView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="#000000"
         android:layout_below="@id/my_toolbar"
         android:id="@+id/list_genre1" />

    <com.github.pedrovgs.DraggableView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:draggable_view="http://schemas.android.com/apk/res-auto"
        android:id="@+id/draggable_view"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        draggable_view:top_view_id="@+id/youtube"
        draggable_view:bottom_view_id="@+id/videoDescription"
        draggable_view:top_view_x_scale_factor="2.3"
        draggable_view:top_view_y_scale_factor="2.3"
        draggable_view:top_view_resize="true"
        draggable_view:paddingEnd="30dp"
        draggable_view:paddingStart="30dp"
        android:background="#000000">

        <com.google.android.youtube.player.YouTubePlayerView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/youtube"/>

        <RelativeLayout android:layout_width="match_parent"
            android:layout_height="match_parent"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/videoDescription"
            android:background="#000000"
            xmlns:android="http://schemas.android.com/apk/res/android">

            . . . .

        </RelativeLayout>
    </com.github.pedrovgs.DraggableView>
</RelativeLayout>

How do I resolve this?

pedrovgs commented 7 years ago

This old bug could be fixed changing how the view is being resized but I can't do it soon. Now I'm working on a different project.

SarthakJoshi commented 7 years ago

What can I do about this bug?

pedrovgs commented 7 years ago

You can enable the "show layout bounds" development option on your device and change the lib fixing the views overlap.

thushcapone commented 7 years ago

Hello @pedrovgs. First things first, thank you for this amazing library. As for this bug that am encountering now, I don't understand the issue, can you explain it to me to help me solve it as If I understand you already know about it!