Structured Concurrency Framework for a Short-Form Video Player
About This Video
Developing a contemporary video player involves significant hurdles, particularly in managing concurrent code execution and ensuring extensibility. This talk details our solution to these prevalent software engineering challenges, demonstrating its application in substantially enhancing an existing video player product.
While structured concurrency frameworks have proven valuable in back-end systems and front-end state management, their integration into a domain like a video player—requiring both extensibility and the flexibility to readily accommodate new platforms or features—demands meticulous design. Video Player SDK users frequently need to incorporate custom behaviours for specific scenarios or handle non-standard manifests. However, conventional architectures often complicate such modifications, increasing the risk of regressions and necessitating significant rework.
The Phoenix framework provides a revolutionary answer by being architected from the outset with structured concurrency, an effect system, and a plugin-first approach. This framework delivers exceptional adaptability and extensibility, effectively addressing a modern set of engineering challenges.
By structuring code into independent plugins with dependency injection and organising asynchronous operations within clearly defined scopes featuring structured concurrency and explicit lifecycles, the framework mitigates resource leaks and guarantees that related tasks are either completed or canceled together.
This framework was employed to create a video player aimed at highly customisable playback applications. The advanced flexibility offered by the Phoenix framework enables the creation of remarkably lean player bundles tailored to specific use cases. As a practical illustration, we evaluated the size and performance for short-form playback. The findings for this player highlight the advantages of such a framework in terms of both performance and size.