Skip to content

Commit

Permalink
fix(FEC-9114): live doesn't work properly with hls.js (#246)
Browse files Browse the repository at this point in the history
change default configuration for LG TV to play with native video player by default instead hls/shaka. Currently we use this only when playing ads.
  • Loading branch information
Yuvalke authored Jun 17, 2019
1 parent 27d7b4b commit f264a24
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/common/utils/setup-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,19 +326,21 @@ function configureVrDefaultOptions(options: KPOptionsObject): void {
* @returns {void}
*/
function configureLGTVDefaultOptions(options: KPOptionsObject): void {
if (isLGTV() && options.plugins && options.plugins.ima) {
const imaForceReload = Utils.Object.getPropertyPath(options, 'plugins.ima.forceReloadMediaAfterAds');
const delayUntilSourceSelected = Utils.Object.getPropertyPath(options, 'plugins.ima.delayInitUntilSourceSelected');
if (isLGTV()) {
const preferNativeHls = Utils.Object.getPropertyPath(options, 'playback.preferNative.hls');

if (typeof imaForceReload !== 'boolean') {
options = Utils.Object.createPropertyPath(options, 'plugins.ima.forceReloadMediaAfterAds', true);
}
if (typeof preferNativeHls !== 'boolean') {
options = Utils.Object.createPropertyPath(options, 'playback.preferNative.hls', true);
}
if (typeof delayUntilSourceSelected !== 'boolean') {
options = Utils.Object.createPropertyPath(options, 'plugins.ima.delayInitUntilSourceSelected', true);
if (options.plugins && options.plugins.ima) {
const imaForceReload = Utils.Object.getPropertyPath(options, 'plugins.ima.forceReloadMediaAfterAds');
const delayUntilSourceSelected = Utils.Object.getPropertyPath(options, 'plugins.ima.delayInitUntilSourceSelected');

if (typeof imaForceReload !== 'boolean') {
options = Utils.Object.createPropertyPath(options, 'plugins.ima.forceReloadMediaAfterAds', true);
}
if (typeof delayUntilSourceSelected !== 'boolean') {
options = Utils.Object.createPropertyPath(options, 'plugins.ima.delayInitUntilSourceSelected', true);
}
}
}
}
Expand Down

0 comments on commit f264a24

Please sign in to comment.