Playing video in a GLSurfaceView instead of SurfaceView
===

I've been struggling with this for 2 days now...
Following this answer: http://stackoverflow.com/a/2006454/444324 - it is mentioned that it's possible to play a video in a GLSurfaceView by altering the MediaPlayerDemo_Video example in API Demos:
 

> All you have to do there is to replace the SurfaceView with a
> GLSurfaceView in both the MediaPlayerDemo_Video.java file as well as
> in the corresponding layout file (mediaplayer_2.xml).
> 
> Also you need to create a custom Renderer class (one that implements
> the GLSurfaceView.Renderer interface) and set it to your
> GLSurfaceView.

I tried replacing the SurfaceView to a GLSurfaceView as suggested, also [using this][1] but it just crashes on start:
 

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.commonsware.android.camera/com.commonsware.android.camera.VideoPlayAndRecord}: java.lang.ClassCastException: android.opengl.GLSurfaceView cannot be cast to com.commonsware.android.camera.GLSurfaceView

Seems like a fairly simple casting mistake but I couldn't find any reason for that... 

I know I can use a VideoView to play a video or just stay with SurfaceView with MediaPlayer but I must use a GLSurfaceView because I need this video to be played on top of the camera surface view.

Thank you!


  [1]: http://stackoverflow.com/q/2108600/444324