Android-youtube-player: Video shows blank screen while audio and controls work

Created on 11 Nov 2019  路  11Comments  路  Source: PierfrancescoSoffritti/android-youtube-player

Hello, I promise I've read all the threads on issues related to this and I've tried all the suggested remedies but still experiencing the following issues.

This is the screen that I see, the video view is basically a blank screen but the audio and controls work.
Screen Shot 2019-11-11 at 3 53 10 PM

Here is my resource file, copied straight from the sample app:

`
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">

    <com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
        android:id="@+id/youtube_player_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:autoPlay="true"
        app:videoId="YE7VzlLtp-4"
        app:showYouTubeButton="false"
        app:showSeekBar="false" />

`

Here is my Activity code:

override fun onCreate(state: Bundle?) { super.onCreate(state) setContentView(R.layout.activity_ads_video_detail) playerView = findViewById(R.id.youtube_player_view) lifecycle.addObserver(playerView) }

The environment I'm testing on:

  • Lib version: 10.0.5
  • Kotlin
  • Pixel 2 Emulator, API 23, x86_64
  • Also reproduced on real Pixel 3 Device running API 28
  • Also tried setting hardwareAccelerated=true in the manifest

I don't think it's a code related issue, but I'm running out of ideas on what to try next... please help! Thank you!

question

Most helpful comment

@AbelTesfaye found the solution for this. Turns out I didn't enable hardware acceleration in the manifest. Thanks

in the AndroidManifest.xml

<application
        ...
        android:hardwareAccelerated="true">
        ...
</application>

All 11 comments

It is expected not to work on emulators, should work fine on pixel 3 though.

But the sample app works on the same emulator?

It is expected not to work on emulators, should work fine on pixel 3 though.

Repros also on a real device (OnePlus)

IMG_1782

Do you have the same problem with the sample app? if not there must be something wrong with the way you're using the library.

Hello, I'm having this same issue did you managed to solve it?

I'm also stuck with this problem, tried everything but still no luck.

@AbelTesfaye found the solution for this. Turns out I didn't enable hardware acceleration in the manifest. Thanks

in the AndroidManifest.xml

<application
        ...
        android:hardwareAccelerated="true">
        ...
</application>

@AbelTesfaye found the solution for this. Turns out I didn't enable hardware acceleration in the manifest. Thanks

in the AndroidManifest.xml

<application
        ...
        android:hardwareAccelerated="true">
        ...
</application>

Its working awesome...Like a magic...
Thanks a lot...

@AbelTesfaye found the solution for this. Turns out I didn't enable hardware acceleration in the manifest. Thanks

in the AndroidManifest.xml

<application
        ...
        android:hardwareAccelerated="true">
        ...
</application>

thank you too!! (thanks to the owner too @PierfrancescoSoffritti )
that solution works

@AbelTesfaye found the solution for this. Turns out I didn't enable hardware acceleration in the manifest. Thanks

in the AndroidManifest.xml

<application
        ...
        android:hardwareAccelerated="true">
        ...
</application>

Was the solution for me as well. @PierfrancescoSoffritti Can you please mark this as the solution as I have seen this in closed tickets as well as a lot of comments regarding this issue.

It's already in the doc.

Was this page helpful?
0 / 5 - 0 ratings