Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/MostafaAnter/VideoPlayerInsideRecyclerView
- Owner: MostafaAnter
- License: apache-2.0
- Created: 2020-06-11T18:28:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-12T11:09:59.000Z (almost 2 years ago)
- Last Synced: 2024-08-07T23:57:37.673Z (6 months ago)
- Topics: autoplay, exoplayer2, facebook, instagram, recyclerview, tiktok
- Language: Kotlin
- Homepage:
- Size: 184 KB
- Stars: 126
- Watchers: 5
- Forks: 25
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)
}
# LicenceCopyright @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 athttp://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.