diff --git a/Docs.md b/Docs.md index 40bea10..fa081af 100644 --- a/Docs.md +++ b/Docs.md @@ -10,6 +10,7 @@ **Templates** - [GiphyDialogFragment](#giphydialogfragment) - [Fresco initialization](#fresco-initialization) +- [Exoplayer cache initialization](#exoplayer-cache-initialization) - [Settings](#gphsettings-properties) - [Theme](#theme) - [Media Types](#media-types) @@ -44,7 +45,7 @@ The latest release is available on [Maven Central](https://search.maven.org/arti Add the GIPHY SDK dependency in the module ```build.gradle``` file: ``` -implementation 'com.giphy.sdk:ui:2.1.13' +implementation 'com.giphy.sdk:ui:2.1.14' ``` ### Configure your API key @@ -117,6 +118,16 @@ Giphy.configure( }) ``` +### Exoplayer cache initialization +The SDK has `Exoplayer` video cache setup. +It's enabled by default: the `videoCacheMaxBytes` value must be greater than 0, otherwise, the SDK will skip cache initialization and [Clips](https://github.com/Giphy/giphy-android-sdk/blob/main/clips.md) won't work. +```kotlin +Giphy.configure( + videoCacheMaxBytes: 100 * 1024 * 1024 + ) +``` +You may want to skip this setup in case you use a different `Exoplayer` version that is incompatible with Giphy SDK but still want to get gifs from Giphy. + ## GPHSettings properties ### _Theme_ diff --git a/Docs_Java.md b/Docs_Java.md index 71101e6..947a6a2 100644 --- a/Docs_Java.md +++ b/Docs_Java.md @@ -10,6 +10,7 @@ **Templates** - [GiphyDialogFragment](#giphydialogfragment) - [Fresco initialization](#fresco-initialization) +- [Exoplayer cache initialization](#exoplayer-cache-initialization) - [Settings](#gphsettings-properties) - [Theme](#theme) - [Media Types](#media-types) @@ -44,7 +45,7 @@ The latest release is available on [Maven Central](https://search.maven.org/arti Add the GIPHY SDK dependency in the module ```build.gradle``` file: ``` -implementation 'com.giphy.sdk:ui:2.1.13' +implementation 'com.giphy.sdk:ui:2.1.14' ``` ### Configure your API key @@ -128,6 +129,16 @@ Giphy.INSTANCE.configure(DemoActivityJava.this, }); ``` +### Exoplayer cache initialization +The SDK has `Exoplayer` video cache setup. +It's enabled by default: the `videoCacheMaxBytes` value must be greater than 0, otherwise, the SDK will skip cache initialization and [Clips](https://github.com/Giphy/giphy-android-sdk/blob/main/clips.md) won't work. +```kotlin +Giphy.INSTANCE.configure(DemoActivityJava.this, + ... + 100*1024*1024, +``` +You may want to skip this setup in case you use a different `Exoplayer` version that is incompatible with Giphy SDK but still want to get gifs from Giphy. + ## GPHSettings properties ### _Theme_ diff --git a/app/build.gradle b/app/build.gradle index 101d903..3ee3758 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ dependencies { implementation "androidx.appcompat:appcompat:1.1.0" implementation "androidx.constraintlayout:constraintlayout:1.1.3" implementation "com.google.android.material:material:1.1.0" - implementation "com.giphy.sdk:ui:2.1.13" + implementation "com.giphy.sdk:ui:2.1.14" implementation 'com.github.bumptech.glide:glide:4.12.0' implementation "com.squareup.leakcanary:leakcanary-android:1.6.3" implementation "com.github.savvyapps:ToggleButtonLayout:1.2.0"