Adding video streaming functionality within an App is becoming more and more important, health care organizations (telemedicine), hospitality (marketing), education (training) are just a few industries that have adopted real time media to conduct their business.
There are several real time protocols to handle video streaming connections like RTMP, HLS, etc. Many popular “free” internet tv channels are delivered using protocols based on HLS through m3u8 playlists.
In this project I decided to create a sample App that shows how to play m3u8 playlists, the app is based on the ijkmedia framework which in turn is based on the ffmpeg project, which is a set of open source libraries that can handle all sort of media formats and protocols.
Video of the app.
The project consists of 3 main views:
- The Player view controler.
- Contains the ijkmedia player
- Provides also additional controls for tagging a favorite, set the thumbnail and description.
- A search panel.
- Links are obtained by doing web scraping to a set of pages.
- A favorites container.
- Presents the tagged favorite m3u8 links.
- Favorites can be re-arranged by dragging them.
The UI part also makes use of core animation and swipe gestures to activate the search, favorites and drawer views.
- Video Manager.
- Handles the user favorites and search requests.
- The search results and favorites data are stored using core data.
- Thumbnails are stored as PNGs in the app sandbox.
- Web scraper.
- Searches for m3u8 playlists in the provided web page link using regexp.
- Open source framework for handling the streaming and playback session.
The app source code and build instructions are in the following github repository: