GIPHY Integration
GIPHY#
VideoEditor SDK allows a seamless integration with the GIPHY Stickers API.
To create a predefined GiphyStickerCategory
, you need to pass your API key obtained from GIPHY.
You can also provide optional language
and rating
parameters to customize search results with respect to the localization and content rating of your app.
let giphyCategory = GiphyStickerCategory(apiKey: "YOUR_API_KEY", language: "en", rating: "g")let configuration = Configuration { builder inlet assetCatalog = AssetCatalog.defaultItemsassetCatalog.stickers.append(giphyCategory)builder.assetCatalog = assetCatalog}
This category is searchable, while the search bar and pagination is provided by VideoEditor SDK.
If no search has been performed the trending API will be used to provide a quick access to the most relevant content, ready to be inserted into the canvas.
A Sticker
created from GIPHY content will use the following properties from the response:
- identifier
- original image URL
- thumbnail URL - selected dynamically depending on available assets for a particular sticker
- title - used as accessibility label, non-localized
For more information about GIPHY see their API Quickstart Guide.
Futher customization, including title and icon may be achieved by using the underlying GiphyStickerProvider
with a StickerProviderCategory
instead.
Make sure that you follow the GIPHY design guidelines.
let giphyProvider = GiphyStickerProvider(apiKey: "YOUR_API_KEY", language: "en", rating: "g")let giphyCategory = StickerProviderCategory(title: "GIPHY", imageURL: Bundle.main.url(forResource: "giphy", withExtension: "png")!, stickerProvider: giphyProvider)let configuration = Configuration { builder inlet assetCatalog = AssetCatalog.defaultItemsassetCatalog.stickers.append(giphyCategory)builder.assetCatalog = assetCatalog}
If you want to implement your own integration with GIPHY (or other) API, see the external sticker provider section.