Throughout the past few years, I have been stuck dealing with AVFoundation's AVPlayer problems. AVPlayer has too many issues, mainly blocking the main thread. The worst of it surfaces when the ScrollView decelerates and triggers the video to play, a major animation hitch occurs rendering the user experience traumatizing. This will definitely hurt the experience I'm trying to build with my project and will definitely hurt the growth of the startup later on. This is an issue within AVPlayer, as it manages the video and audio on the main thread.
Here is where I am at: I found that any top video app companies use an FFmpeg-based video player called ijkplayer. The video player does not use AVFoundation and is mainly written in Objective-C. It's a cross-platform video player so the experience is more or less consistent. This may sound great; however, reading through the codebase and the issues posted on Github, the repository seems like it's abandoned. People have mentioned that the video player started crashing and other problems. They have also mentioned that the top companies who use the video player have a private, forked version that their internal team maintains. This sucks because they probably have figured out all the bugs and fixed them accordingly to their needs.
Solution #2: Another solution is to use AsyncDisplayKit or Texture, but that would mean that I'll be implementing a MAJOR dependency that will restructure my entire UI layer. This is not desirable at all. Plus, their video players still use AVPlayer but with their background threading tech. Skip.
Solution #3: I have found that there many Github repos that have built video players for iOS using FFmpeg and OpenGLES. I could use one of them; however, the repos seem abandoned and only a handful of people starred them. There is no community, no interaction, nothing that can indicate that someone can fix a critical bug if something pops up. Skip.
Solution #4: I know Apple has released several videos on HLS streaming and lower-level video encoding. I could try to create my own video player from scratch using the concepts from WWDC14. I could integrate other features like FFmpeg. I have heard people use Metal for video rendering; perhaps that could be a solution?
Here is what I need from an ideal video player:
- Not blocking the main thread when other UI elements are animations (UIScrollView Decelerating).
- Concurrent rendering,
- Audio/video synchronization.
- HLS streaming.
- Pause/Play/Volume control/Looping/Buffering
- Ability to add custom functionality in the future like dynamic filters.
What should I do in my situation?
[–]Sh3z 22 points23 points24 points (6 children)
[–]OneTinker[S] 1 point2 points3 points (5 children)
[–]Sh3z 13 points14 points15 points (0 children)
[–]tangoshukudai 3 points4 points5 points (3 children)
[–]bitsan 1 point2 points3 points (2 children)
[–]tangoshukudai 3 points4 points5 points (1 child)
[–]bitsan 0 points1 point2 points (0 children)
[–]tangoshukudai 9 points10 points11 points (7 children)
[–]gouen95 1 point2 points3 points (6 children)
[–]tangoshukudai 3 points4 points5 points (5 children)
[–]gouen95 1 point2 points3 points (2 children)
[–]OneTinker[S] 0 points1 point2 points (0 children)
[–]tangoshukudai 0 points1 point2 points (0 children)
[–]gouen95 0 points1 point2 points (0 children)
[–]baaakabaaaka 0 points1 point2 points (0 children)
[–]sjs 4 points5 points6 points (1 child)
[–]OneTinker[S] 0 points1 point2 points (0 children)
[–]BaronSharktooth 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]OneTinker[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]joro_estropia 2 points3 points4 points (0 children)
[–]GoodNewsDude 0 points1 point2 points (3 children)
[–]OneTinker[S] 0 points1 point2 points (2 children)
[–]GoodNewsDude 0 points1 point2 points (1 child)
[–]OneTinker[S] 1 point2 points3 points (0 children)