[object Object] Icon

Learn how to create, start, manage and modify Encodings

[object Object] Icon

Learn how to create, start, manage and modify Players

[object Object] Icon

Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Wed Mar 23 2022

Smart TVs configuration and best practices

Wed Mar 23 2022

CompatibilityLink Icon

This article is related to Bitmovin Web SDK and SmartTVs that leverage it. Android TV, Google TV, FireTV and tvOS are out of scope of this article.

Smart TVs are typically resource-constrained devices with limited Memory and CPU capacity. Also the APIs for streaming and DRM handling (MSE/EME) on these platforms are generally incompatible with latest standards of Desktop browsers.

Know your deviceLink Icon

Know your environment by researching the documentation on each Smart TV platform and OS release:

  1. Tizen documentation on web environments by version
  2. LG WebOS documentation on web environments

Start with Bitmovin sample repositoriesLink Icon

The Bitmovin samples are the best resources to get start it with your Smart TV app.

  1. bitmovin-player-tizen-demo
  2. bitmovin-player-webos-demo

Use and retain the best practices demonstrated in the sample apps as a baseline:

  1. Use of the modular player. This keeps the player footprint as small as possible, useful for constrained environments.

  2. Use of the respective platform modules. There are specific modules created for both Tizen and WebOS. While these modules are not 100% necessary for all use cases on all devices, they are recommended to be included as a baseline.

  3. Proactive management of the player buffer. Reducing the front and back buffer reduces player's overhead in managing the buffer, important for lower-resourced devices. The specific settings here (30 for front buffer; 10 for back buffer) are good starting recommendations, but should be tweaked based on segment length used in your streams. For example, with 4s segments, you might adjust this to be 16s or 12s for the front buffer and 12s for the back buffer. And, whenever possible, steer away from formats and features that will require additional processing - and therefore resources - as these will play a factor in playback performance. For example, prefer MP4 over TS containers, as the player will have to transmux TS (overhead of converting MPEG-2 TS container into MP4 "on the fly” ).

Special player configurationsLink Icon

tweaksconfig settings

  • Required tweaksConfig settings:
  1. file_protocol:true (only required if the app’s HTML page is put within the TV app. For apps hosted on a remote server it isn’t necessary).

Since some of the devices are not as well equipped, it is furthermore recommended to limit the players buffer:

1// you can't use the direct assigments with {[bufferType]: 40]} since older device versions only support ES5
2var bufferConfig = {};
3var bufferLevels = {};
4bufferLevels[bitmovin.player.core.BufferType.ForwardDuration] = 30;
5bufferLevels[bitmovin.player.core.BufferType.BackwardDuration] = 10,
6bufferConfig[bitmovin.player.core.MediaType.Video] = bufferLevels;
7bufferConfig[bitmovin.player.core.MediaType.Audio] = bufferLevels;
9playerConfig.buffer = bufferConfig;
  • Analytics Configuration:
  1. origin is required to have Analytics data flow appropriately when the HTML page is put within the TV App. This should match the value you have set for your app_id and added to the allow-list in your player account.

Streaming Format and DRM ConsiderationsLink Icon

General Recommendations by Platform:

  1. Tizen 2.4 (2016) - Playready (DASH + PR/CENC)
  2. Tizen 3.x+ (2017+) - Widevine (DASH + WV/CENC)
  3. WebOS 3.x+ (2016+) - Widevine (DASH + WV/CENC)

Specific configuration recommendations:

Playready DRM: These settings may not be universally needed for Playready DRM, but are good starting points when attempting PR playback on SmartTV devices.

1utf8message: true,
2plaintextChallenge: true,
3headers: {'Content-Type': 'text/xml'}

DASH: Some older Tizen model streaming API might attempt to default to native playback. Ensuring that preferredTech is appropriately set in the playbackConfiguration helps avoid this situation:

1 playback : {
2 autoplay : true,
3 muted : false,
4 preferredTech : [{
5 player: 'html5',
6 streaming: 'dash',
7 }]
8 }

Streams with high playback times

It has been observed, that the Tizen2016 TV has failed to playback streams which have high resulting playback times (~1_600_000_000). It is known, that the device cannot decode BaseMediaDecodeTimes greater than 2^32 bit, but it might already fail with lesser values. If a stream fails to start playback (or if you observe multiple seek operations in rapid succession), it can help to force the BaseMediaDecodeTime rewriting by setting the tweak FORCE_BASE_MEDIA_DECODE_TIME_REWRITE: true

Device InformationLink Icon

It is useful to get information logged out directly from the device, especially when submitting logs for further investigation, so readers know exactly where they came from. Device information from the OS can also be informative in terms of profiling and resource utilisation.

WebOS deviceInfo Example: Using WebOs API Services it is possible to obtain valuable information from the LG smartTV. Please. refer to WebOS API documentation to understand how to use it.

Please be sure to include the webOSTV.js into your application in order to use the API.

1function deviceInfo () {
2 var request = webOS.service.request("luna://com.webos.service.tv.systemproperty", {
3 method: "getSystemInfo",
4 parameters: {
5 "keys": ["modelName", "firmwareVersion", "UHD", "sdkVersion"]
6 },
7 onComplete: function (inResponse) {
8 var isSucceeded = inResponse.returnValue;
10 if (isSucceeded){
11 console.log("deviceInfo Result: " + JSON.stringify(inResponse));
12 // To-Do something
13 } else {
14 console.log("Failed to get TV device information");
15 // To-Do something
16 return;
17 }
18 }
19 });

Tizen segmentPlayback Memory Usage Example:

Tizen TVs provide an API that allows obtaining different types of information from the device.

Please review the Tizen SystemInfo documentation to understand its usage and capabilities.

As opposed with WebOS, there is no need to include any Js file or reference to this API, as it will become available globally when the application runs on a Tizen device.

1player.on(bitmovin.player.core.PlayerEvent.SegmentPlayback, function(data) {
2 console.log("segment played back: " + JSON.stringify(data));
3 console.log("total memory: " + tizen.systeminfo.getTotalMemory() / (1000*1000) + "MB avail memory: " + tizen.systeminfo.getAvailableMemory() / (1000*1000) + "MB");
4 });

What's nextLink Icon

Getting Started Guides

Give us feedback