toro icon indicating copy to clipboard operation
toro copied to clipboard

Youtube App Video Auto Pause

Open perusudroid opened this issue 5 years ago • 16 comments

What kind of issue is this?

  • In YouTube player app, if i place view above player the player i get Unauthorised overlay error message. After removing it, i have just the player alone in the layout removing all other views, am not getting the error message in toast but the player get paused.

Once the player is automatically paused, even after the activity or fragment destroyed and recreated also, can't able to play the video as it automatically pauses.

If the video is auto paused, it not only affects the activity or fragment where it is implemented, but also the other activity or fragment where the player is implemented.

How i could completely release the player?? I tried to release the player in onDestroy() of the fragment. But still i couldn't figure out what is actually wrong!. My app is Live with toro youtube player. Please help to resolve it.

perusudroid avatar Apr 24 '19 05:04 perusudroid

Can you explain why you want to completely release the player? In my demo if the RecyclerView that use Youtube player is detached, everything will be released.

Still not get all your issue. Please explain it in steps: what do you want to archive, what is the trouble now? what is the “thing” that is the main issue in your app?

eneim avatar Apr 24 '19 11:04 eneim

Hi, here is the link to my app, https://play.google.com/store/apps/details?id=com.perusudroid.myhero

I have used your Demo for Playing YouTube videos in RecyclerView, Thanks for sharing such a wonderful demo app. Without which i might not able to used it in my app. Please see in the app, after scrolling down, somewhere the app stops playing the video and then actually it never release at all. I mean, untill the app is reopened that issue remains, You could see it live. Thanks..

perusudroid avatar Apr 25 '19 05:04 perusudroid

@perusudroid I cannot reproduce the issue. Can you take a record of your screen and send me?

eneim avatar Apr 25 '19 06:04 eneim

Please look at the video i have attached. If it is an Un-Authorized overlay toast will popup. But when i scroll and switch to next video, video autopauses. https://drive.google.com/file/d/13hWpV3FdaUKIOQZmr1qigXj460Ab3cxt/view?usp=sharing

perusudroid avatar Apr 25 '19 06:04 perusudroid

@perusudroid is the issue solved?? Got any solution?? I am also facing the same issue, plz help me out if any solution.

venkateshimmidi avatar Jun 03 '19 06:06 venkateshimmidi

Hi there,

Nope. I am in search of other good library to replace it.

On Mon, Jun 3, 2019 at 11:47 AM venkateshimmidi [email protected] wrote:

@perusudroid https://github.com/perusudroid is the issue solved?? Got any solution?? I am also facing the same issue, plz help me out if any solution.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eneim/toro/issues/439?email_source=notifications&email_token=AFBKK4Y26H4DX6KFQE7CQ3LPYSZPHA5CNFSM4HIAL262YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWYM7JY#issuecomment-498126759, or mute the thread https://github.com/notifications/unsubscribe-auth/AFBKK43WKYS4PXHDHXVVS23PYSZPHANCNFSM4HIAL26Q .

perusudroid avatar Jun 03 '19 06:06 perusudroid

thanks for the quick response. Pls let me know if any thing found. I am also searching for other library.

venkateshimmidi avatar Jun 03 '19 06:06 venkateshimmidi

For which purpose you use this library?. Is your app @ playstore?

On Mon, Jun 3, 2019 at 11:55 AM venkateshimmidi [email protected] wrote:

thanks for the quick response. Pls let me know if any thing found. I am also searching for other library.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eneim/toro/issues/439?email_source=notifications&email_token=AFBKK45IDM2WUTL5H66645TPYS2OPA5CNFSM4HIAL262YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWYNNQI#issuecomment-498128577, or mute the thread https://github.com/notifications/unsubscribe-auth/AFBKK46IHR54RZXPXP2GTY3PYS2OPANCNFSM4HIAL26Q .

perusudroid avatar Jun 03 '19 06:06 perusudroid

No not yet in playstore. Still in development. We have a requirement of playing youtube videos like youtube app.

venkateshimmidi avatar Jun 03 '19 06:06 venkateshimmidi

@perusudroid How often the issue happens to your app? Can you share the xml of the Card you put YouTube fragment to? I'm restarting the work with YouTube this week, maybe I can see a work around. As said, YouTube Player SDK is not friendly enough to have a fully working implementation.

eneim avatar Jun 05 '19 04:06 eneim

can i use any other player instead of Exoplayer and youtube player with toro??

venkateshimmidi avatar Jun 06 '19 06:06 venkateshimmidi

@venkateshimmidi What do you mean by other player?

If you want to play YouTube videos, you need either YouTube Android Player API or its IFrame API (there is a wrapper for Android).

If you want to play normal Video using player other than ExoPlayer, it is Ok. You will need to write your own version of Helper for it. Check my legacy demo to see how I build it for Android's MediaPlayer API.

eneim avatar Jun 06 '19 07:06 eneim

@perusudroid How often the issue happens to your app? Can you share the xml of the Card you put YouTube fragment to? I'm restarting the work with YouTube this week, maybe I can see a work around. As said, YouTube Player SDK is not friendly enough to have a fully working implementation.

On scrolling the page top to bottom and from bottom to top, continuously, then on playing the youtube video then video video gets started after 1 sec it stops and gets the error msg in logcat like.."YouTubeAndroidPlayerAPI: YouTube video playback stopped due to the player's view being too small. The YouTubePlayerView is 0dp wide (minimum is 200dp) and 0dp high (minimum is 110dp)."

My xml is:

<android.support.v7.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    app:cardCornerRadius="0dp"
    app:cardElevation="1dp"
    >

  <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical">

    <im.ene.toro.youtube.common.AspectRatioFrameLayout
        android:id="@+id/player_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="350dp"
        app:resize_mode="fixed_width">

      <FrameLayout
          android:id="@+id/player_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="#000">
      </FrameLayout>

      <android.support.v7.widget.AppCompatImageView
          android:id="@+id/thumbnail"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:scaleType="centerCrop"/>

    </im.ene.toro.youtube.common.AspectRatioFrameLayout>

    <TextView
        android:id="@+id/video_id"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="start"
        android:padding="8dp"
        android:textAppearance="@style/Base.TextAppearance.AppCompat.Body2"
        />

    <TextView
        android:id="@+id/video_description"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:ellipsize="end"
        android:gravity="start"
        android:maxLines="5"
        android:paddingBottom="8dp"
        android:paddingEnd="8dp"
        android:paddingStart="8dp"
        android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
        />

  </LinearLayout>

</android.support.v7.widget.CardView>

venkateshimmidi avatar Jun 20 '19 13:06 venkateshimmidi

@venkateshimmidi Please try to set a fix height (big enough) for your android:id="@+id/player_view" and also remove the ImageView on top of it and retry.

eneim avatar Jun 21 '19 13:06 eneim

yes i have tried with the given suggestion but still it is showing the same error.

On Fri, Jun 21, 2019 at 7:10 PM Nam Nguyen Hoai [email protected] wrote:

@venkateshimmidi https://github.com/venkateshimmidi Please try to set a fix height (big enough) for your android:id="@+id/player_view" and also remove the ImageView on top of it and retry.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eneim/toro/issues/439?email_source=notifications&email_token=AEITRCSSNOT7VMHYO4ZHKFLP3TK5NA5CNFSM4HIAL262YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYIPYUA#issuecomment-504429648, or mute the thread https://github.com/notifications/unsubscribe-auth/AEITRCU4HGOGGWHFRUQEWGLP3TK5NANCNFSM4HIAL26Q .

venkateshimmidi avatar Jun 24 '19 07:06 venkateshimmidi

I think there is a problem with the progress bar(but not sure). But there is no option to hide it, it is internally coming from the library. Can you help me with this?

On Mon, Jun 24, 2019 at 12:31 PM immidi venkatesh < [email protected]> wrote:

yes i have tried with the given suggestion but still it is showing the same error.

On Fri, Jun 21, 2019 at 7:10 PM Nam Nguyen Hoai [email protected] wrote:

@venkateshimmidi https://github.com/venkateshimmidi Please try to set a fix height (big enough) for your android:id="@+id/player_view" and also remove the ImageView on top of it and retry.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eneim/toro/issues/439?email_source=notifications&email_token=AEITRCSSNOT7VMHYO4ZHKFLP3TK5NA5CNFSM4HIAL262YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYIPYUA#issuecomment-504429648, or mute the thread https://github.com/notifications/unsubscribe-auth/AEITRCU4HGOGGWHFRUQEWGLP3TK5NANCNFSM4HIAL26Q .

venkateshimmidi avatar Jun 28 '19 06:06 venkateshimmidi