5

First, I'd like to point out that there seems to be a limitation in Android in which having a SurfaceView on a ScrollView doesn't work as you would expect. This is explained here (VideoView uses a SurfaceView internally so it has this problem). But there seems to be a workaround for VideoView which worked for me.

Now, I also want to use the new YouTube API for Android to display embedded YouTube videos on our Android app. The YouTubePlayerView which implements the embedded video player also presents the problem mentioned above since it uses a SurfaceView as shown below in the hierarchy viewer.

SurfaceView on the YouTubePlayerView

I haven't been able to find a workaround for this problem. Having a YouTubePlayerView on a ScrollView is a fairly common use case for our app (and probably for many others too). I would appreciate any comments on this.

Community
  • 1
  • 1
Juan Andrés Diana
  • 2,215
  • 3
  • 25
  • 36

1 Answers1

0

I would like this functionality too, but alas, it seems it is still being implemented by Google.

See here: https://code.google.com/p/gdata-issues/issues/detail?id=4514

The solution should be to use a TextureView which supports playing videos within a ScrollView. Hopefully YouTube API supports this soon.

Community
  • 1
  • 1
CzarMatt
  • 1,773
  • 18
  • 22