Going Big Screen: How to Deliver video to LG WebOS using MSE/EME APIs
by Pieter-Jan Speelmans on February 16, 2021
THIS IS A SNIPPET OF OUR “GOING BIG SCREEN: BRINGING VIDEO TO LG WEBOS” GUIDE WHICH YOU CAN DOWNLOAD HERE.
Previously, we’ve covered how to bring your applications to LG webOS, and 6 things to keep in mind when considering LG webOS’s native video player. In this blog, we will talk about how to leverage LG webOS’s MSE/EME capabilities to deliver your audio and video content.
MSE and EME APIs
The Media Source Extension (MSE) API and the Encrypted Media Extension (EME) API are available on all later webOS models. Where MSE provides access to media decoders, EME allows you to access the Content Decryption Module (or CDM) which allows you to leverage the platform’s DRM capabilities.
Using the MSE/EME approach is far from a new thing when it comes to media playback. Native players on most browser platforms are often even more limited compared to webOS’ native media playback capabilities. As a result nearly every website playing media is making use of these APIs to power high end media experiences. If you have a website, odds are pretty high you are doing the same thing (unless you are still stuck on Flash for some reason).
The Importance of a Capable Video Playback Component
Where THEOplayer was the first media player to do complex handling of media in browser environments (even without the use of MSE/EME), various other companies started providing libraries since the APIs became available. As MSE and EME are only APIs, there is however more than meets the eye: development based on these APIs still requires a proper understanding of media and the web as the entire implementation of the streaming protocols has to happen in dedicated code. In most cases, fully featured media players have to go above and beyond that in order to bring a truly rich viewer experience.
Even with all of the basics implemented, there is a large difference between media player options. While some media players only provide basic playback such as open-source libraries hls.js, dash.js and Shaka Player providing support for the HLS or MPEG-DASH protocol, more advanced players such as THEOplayer provide even more support such as integrations with various DRM systems, monetisation options with CSAI and SSAI, picture in picture support, support for offline downloading, …
MSE/EME Support on Different LG webOS Versions
While webOS does bring support for all of the required APIs to use any framework, there are some significant differences in implementations. On one end, most (open source) playback implementations assume the MSE and EME APIs are fully up to date. On webOS however this is not the case as you can see in the table below:
As MSE/EME implementations can be quite old on webOS (with only webOS 5.x to be on the recommendation), it’s crucial to have a playback library which works with those old versions. On top of this, webOS also tends to have specific decoder behavior due to hardware being significantly different from standard browser environments on laptop or mobile. This can be expressed in things such as seeking only to key frames on specific versions, not allowing changes in playback rate, how the buffer is exposed etc. All of this means it is crucial your playback library supports all webOS versions where you plan to deploy.
Using Open Source Video Player on LG webOS
While they usually work on the platform, most common open source playback rarely have official support for webOS. With smart TV platforms being forgotten and not making it into the testing cycle this opens up a risk. For example, the compatibility list of hls.js does not list webOS, dash.js doesn’t list any platforms at all and only claims to rely on MSE being implemented and Shaka Player mentions webOS is not officially supported, but “expected to work”. At THEOplayer, we actively support the webOS platform and have code to handle differences and quirks compared to a standard browser environments in our THEOplayer Web SDK such as handling for limitations in the number of decoders which can be used in parallel, switching from one video codec into another, enabling and disabling DRM, handling for higher bitrates, alternative codecs and HDR content on big screens just to name a few.
The compatibility problem doesn’t just show in regard to testing. As already mentioned earlier, there are still significant differences in the web environment, MSE and EME implementations across different Tizen versions. Where most players assume an always up-to-date API, this is not the case on smart TV platforms such as webOS for which different models often support draft specifications only.
In our next blog we are going to wrap up our webOS blog series by discussing which approach you should take for your use case. You can also download the complete version of this topic in our “GOING BIG SCREEN: BRINGING VIDEO TO LG WEBOS” ebook here.