mklimek / frame-video-view

Less issues with VideoView
Other
63 stars 19 forks source link

Fix for a re-initialization issue on surface destruction. #9

Closed m-kubis closed 8 years ago

m-kubis commented 8 years ago

A re-initialization issue on surface destruction fixed. For example when placing the video into the RecyclerView. The recycling of the view can be handled with #onResume()/#onPause() with the RecycleView#onBindViewHolder(...)/#onViewRecycled(...) callbacks. However the surface state change callbacks of the implementation are not accessible from the outside. The exact moment the texture view goes out of view (the last pixel scrolls out of the screen), TextureViewImpl#onSurfaceTextureDestroyed(Surface) gets called and the following onSurfaceTextureAvailable(Surface) doesn't initialize the media player due to not being released (and flag set).

The player should be properly released and the placeholder view shown on surface destruction now.