npr
npr

Reputation: 4775

Is it possible to have custom seekbar for YoutubePlayerView

My app uses youtube android sdk to play videos within an activity. And default seekbar matches that of youtube app.

Is it possible to have a custom seek bar - something like below.

[sorry - this is my first post and I cant post images] https://www.dropbox.com/s/twldkm1v42adjyu/blue.png?dl=0

Below is YoutubePlayerView init code in OnCreate()

    youtubePlayerView = (YouTubePlayerView)findViewById(R.id.youtube_view);
    youtubePlayerView.initialize(Config.DEVELOPER_KEY, this);

Reference of YoutubePlayerView is here : https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayerView

One of the constructors takes AttributeSet in its argument (below) - will that be useful ? If not how to go about this - please help.

    YouTubePlayerView(Context context, AttributeSet attrs);

Upvotes: 1

Views: 1685

Answers (1)

Sebastiano
Sebastiano

Reputation: 12339

You cannot style the YouTubePlayerView, you can only pick one between the following styles: DEFAULT, CHROMELESS, MINIMAL (doc).

You cannot even place views over the view, otherwise playback will stop.

What you can do is setting the CHROMELESS style to the player and manually place a Seekbar under the player view. With that, you will then send seek events to the player.

Upvotes: 2

Related Questions