Version: 2.67.0

How to customize the quality selector & labels?

Some of our customers prefer MP4 assets over HLS/MPEG-DASH ones. One major downside to this approach is that Adaptive Bitrate Streaming (ABR) is not possible with such streams, as they don't have a playlist with multiple qualities.

To counter this, we've made it possible to pass on a list of MP4 qualities & switch between them manually, to improve the overall UX. What is nice about this piece of integration code, is that it can be tweaked and applied to customise other parts of the default UI as well!

Let's dig in:

First of all, we need to set up the player (don't forget to edit the placeholders to match your setup):

Setup playerExpand source

// setting up the player
element = document.querySelector("#video-container");
player = new THEOplayer.Player(element, {
libraryLocation: "release/",
ui: {
fluid: true
player.src = "/demo/assets/your.mp4";

Then, the different MP4 qualities of the same asset need to be stated, along with the corresponding resolutions:

Set sourcesExpand source

// set your resolutions and sources
var resolutions = [
{ name: "360p", src: "" },
{ name: "540p", src: "" },
{ name: "720p", src: "" }

Now for the slightly trickier part:

Removing current & adding custom menuExpand source

var currentTime, wasPaused;
var settingsMenu = player.ui.getChild("ControlBar").getChild("SettingsButton")
// Remove built-in quality sub menu
// Create custom quality sub menu
var qualityMenuItem = settingsMenu.addSubMenuItem({
index: 0
var qualityMenuTitle = document.createElement("span");
qualityMenuTitle.className = "theo-settings-control-menu-item-title";
qualityMenuTitle.innerHTML = "Quality";
var qualityMenuValue = document.createElement("span");
qualityMenuValue.className = "theo-settings-control-menu-item-value";
qualityMenuItem.subMenu.menuHeader.el().innerHTML = "Quality";
var qualityItems = {
var qualityItem = qualityMenuItem.subMenu.addMenuItem();
qualityItem.el().innerHTML =;
qualityItem.on("click", function() {
return qualityItem;
function selectQuality(resolution) {
qualityMenuValue.innerHTML =;
currentTime = player.currentTime;
wasPaused = player.paused;
player.src = resolution.src;
player.currentTime = currentTime;
if (!wasPaused) {;
var qualityItem = qualityItems[resolutions.indexOf(];
qualityItems.forEach(function(item) {
item.selected(item === qualityItem);

You can now select multiple qualities of the same MP4 asset!