Android VideoView cache
Cache wrapper for standart android VideoView
It uses okhttp and rxjava inside. Nothing special is needed to use.
Setup:
- Add
maven { url 'https://jitpack.io' }
to theallprojects
ordependencyResolutionManagement
section in top-levebuild.gradle
orsettings.gradle
.
For example (settings.gradle
):
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" }
}
}
- Add implementation
'com.github.Andrew0000:Android-VideoView-cache:1.0.3'
(chek latest version) to the module-levelbuild.gradle
Usage:
Like a VideoView.
For example in xml:
">
And then start loading:
cachedVideoView2.playUrl("https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4")
That's all!
Video will be downloaded, cached and played.
On the next invocation it will be loaded from cache.