Customers that use THEOplayer in mobile web which leverage THEOplayer's preloading capabilities (preload = "auto"
), or provide very high qualities, sometimes receive complaints about data usage.
You can combat this by leveraging the ABR API and the MediaTrack API.
player.abr.targetBuffer
property, which allows you to configure the amount of seconds to buffer ahead of the current playback position. The standard buffer time is 20 seconds. These 20 seconds are also employed when preloading content.and limit the buffer that will be preloaded through preload = "auto":
The snippet below sets the targetBuffer to 6 seconds.
player.abr.targetBuffer = 6;
The snippet below sets the targetBuffer to 6 seconds.
theoplayer.getPlayer().getAbr().setTargetBuffer(6);
The iOS SDK does not allow you to change the targetBuffer. The iOS SDK's ABR API only allows you to change the ABRStrategyType.
The snippet below leverages THEOplayer's Video.js component. THEOplayer uses Video.js for its default UI.
if (THEOplayer.videojs.browser.IS_ANDROID || THEOplayer.videojs.browser.IS_IOS || ... ) {
player.abr.targetBuffer = 6;
}
The snippet below enables preloading
Enable preloading: player.preload = "auto"; // "metadata" is also a valid value
Enable preloading: theoplayer.getPlayer().setPreload(PreloadType.AUTO);
theoplayer.setPreload(.auto)
These two strategies can reduce the data usage on (mobile) devices drastically.