How to play .GIFV and .WEBM on iOS
I am making an reddit client app. So far I have been successfully able to play gif on iOS using FLAnimatedImage library. However for majority of the "gifs" now a days are "gifv" format from imgur and "webm" from gfycat.
Is there any way to play them on iOS? I researched and know that these 2 formats are just fancy videos. However even avplayer won't play them. The official imgur app is able to play them so there has to be a way.
GIF formats are okay but problem arises for bigger files where we need to download the entire file first and that takes time. GIFV plays continuously without having to download the entire file. Hence I need someway to play them in my app.
@sschale thanks! yes, seems like imgur's gifv is basically mp4 video without audio. So I ended up using avplayer with each URL replaced with mp4 instead of gifv. Same webm replaced with mp4. Added a whole bunch of extra configuration for looping of video etc and got it to work seamlessly. In order for the avplayer to not pause background playing music of other apps, I added:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient withOptions:0 error:nil];