PierfrancescoSoffritti / android-youtube-player

YouTube Player library for Android and Chromecast, stable and customizable.
https://pierfrancescosoffritti.github.io/android-youtube-player/
MIT License
3.43k stars 764 forks source link

Remove Player Menu and only show Iframe menu #1105

Open lluzalves opened 9 months ago

lluzalves commented 9 months ago

Question

Summary

Hello, I tried to remove the native player control, so it can only show the Iframe control. But the native menu container seems to always overlay the iframe menu player.

        val iFramePlayerOptions = IFramePlayerOptions
            .Builder()
            .ccLoadPolicy(1)
            .ivLoadPolicy(3)
            .controls(1)
            .build()
  view.youtube_player_view.getPlayerUiController().showMenuButton(false)
       view.youtube_player_view.getPlayerUiController().apply {
            showMenuButton(false)
            showBufferingProgress(false)
            showDuration(false)
            showPlayPauseButton(false)
            showSeekBar(false)
        }
        view.youtube_player_view.initialize(object : AbstractYouTubePlayerListener() {
            override fun onReady(youTubePlayer: YouTubePlayer) {
                youTubePlayer.loadVideo("some_id", 0f)
            }
        }, true, iFramePlayerOptions)

If I set showUi(false)

  view.youtube_player_view.getPlayerUiController().showMenuButton(false)
       view.youtube_player_view.getPlayerUiController().apply {
            showUi(false)
        }

I can see the iframe menu/control at the start but after a second it is gone and whenever I click on the video it does not show again.

PierfrancescoSoffritti commented 9 months ago

Hi, which version of the library are you using?

lluzalves commented 9 months ago

Hi @PierfrancescoSoffritti , currently using this 10.0.5

PierfrancescoSoffritti commented 9 months ago

Please consider updating to the latest version :) web ui si the default there, an that's the recommended way to use the library.

lluzalves commented 9 months ago

Thanks @PierfrancescoSoffritti , will check.

viraldesai108 commented 1 month ago

Image 1 Showing the Ui change error please resolve it

PierfrancescoSoffritti commented 1 month ago

You need to include the custom-ui module.

 implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:custom-ui:12.1.0'