Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/MostafaAnter/VideoPlayerInsideRecyclerView

Integrate RecyclerView with ExoPlayer — The clean way — and customization
https://github.com/MostafaAnter/VideoPlayerInsideRecyclerView

autoplay exoplayer2 facebook instagram recyclerview tiktok

Last synced: about 2 months ago
JSON representation

Integrate RecyclerView with ExoPlayer — The clean way — and customization

Awesome Lists containing this project

README

        

# VideoPlayerInsideRecyclerView
Integrate RecyclerView with ExoPlayer — The clean way — and customization
this is the implementation of that article [meduim article](https://medium.com/mindorks/working-with-exoplayer-the-clean-way-and-customization-fac81e5d39ba)

# Demo

[Youtube video](https://youtu.be/KynEZzerD8M)

# Tips

### for smooth scrolling and avoiding players overlaps use `TextureView` nested of `SurfaceView`

Note, `TextureView` can only be used in a hardware accelerated window. When rendered in software, TextureView will draw nothing. so after set surface type

you need to make sure that hardware acceleration is enabled, go to manifest file and ad this line

- At application level: ``

### implement `onViewRecycled` inside your adapter then call player.release to release player when item is recycled

override fun onViewRecycled(holder: RecyclerView.ViewHolder) {
val position = holder.adapterPosition
releaseRecycledPlayers(position)
super.onViewRecycled(holder)
}





# Licence

Copyright @2020 by Mostafa Anter

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.