Building the Prototype
To bring the concept into reality, we started by analyzing the objective, identified the features, and defined the workflow. Delivering the full set of features within the stipulated timeline was the initial challenge. We took it on nevertheless and successfully presented a full-fledged working prototype. The prototype included major features such as the latest and trending media content, options to stream/download the files and search for artists, a user library, and user profile. Apart from the mobile application, we also identified the need for an admin panel to serve as a management system. The management system would help manage the user base, upload and tag the content, assign the artists and content providers. With the go-ahead from the client, we started converting the concept to code. One of the key challenges we would address while building the streaming and downloading features is quality adjustments to adapt to the requesting bandwidth.How Streaming Apps Work
Streaming apps work based on streaming protocols, which chop up the media content into encoded short elements called chunks. These chunks, a stream of data, are then delivered from the server to the clients. The server, information stream, and decoder then work together to let people watch the live or prerecorded telecasts. An important aspect for consideration while building a streaming application is adaptive bitrate streaming. This multimedia streaming technique is a combination of server and client software that detects a client’s bandwidth capacity and adjusts the quality of the media stream between multiple bitrates and/or resolutions. It requires the use of an encoder which can encode a single source media (video or audio) at multiple bit rates. The player client hence switches between streaming the different encodings depending on available resources. HTTP Live Streaming (HLS), a media streaming protocol, is widely used for streaming applications, as it has emerged as the standard in adaptive bitrate media. The HLS streaming protocol breaks down the media content into short 10-second chunks, which are then delivered to the viewers by HTTP. This technology makes HLS compatible with a wide range of devices and firewalls.How We Achieved Streaming in Baiskoafu App
Baiskoafu also follows the HLS protocol. All the media content is uploaded and managed through the admin panel. The content undergoes elastic transcoding, which transcodes them into different qualities and stores them in Amazon Web Service S3 buckets. Each media file has an associated m3u8, a playlist file, which includes references (URLs) to all the available qualities. For Baiskaofu, we kept four m3u8 files against each content, including:- Master: Contains references to all qualities in this playlist file
- Low: Contains only low-quality reference
- Medium: Contains only medium-quality reference
- High: Contains only high-quality reference