|
1 | 1 | import defaults from 'config/defaults'; |
2 | 2 | import isEmpty from 'lodash/isEmpty'; |
3 | | -import isObject from 'lodash/isObject'; |
4 | 3 |
|
5 | 4 | const hasConfig = (obj) => isEmpty(obj) ? null : true; |
6 | 5 |
|
@@ -44,7 +43,7 @@ const getSourceOptions = (sourceOptions = {}) => ({ |
44 | 43 | } : {}), |
45 | 44 | ...(hasConfig(sourceOptions.textTracks) ? getTextTracksOptions(sourceOptions.textTracks) : {}), |
46 | 45 | interactionAreas: hasConfig(sourceOptions.interactionAreas), |
47 | | - videoSources: !!sourceOptions.videoSources || null, |
| 46 | + videoSources: hasConfig(sourceOptions.videoSources), |
48 | 47 | }); |
49 | 48 |
|
50 | 49 | const getTextTracksOptions = (textTracks = {}) => { |
@@ -96,8 +95,7 @@ export const getAnalyticsFromPlayerOptions = (playerOptions) => filterDefaultsAn |
96 | 95 | autoplayMode: playerOptions.autoplayMode, |
97 | 96 | bigPlayButton: playerOptions.bigPlayButton, |
98 | 97 | className: playerOptions.class, |
99 | | - cloudinaryAnalytics: !!playerOptions.cloudinaryAnalytics, |
100 | | - cloudinaryAnalyticsOptions: isObject(playerOptions.cloudinaryAnalytics) || null, |
| 98 | + cloudinaryAnalytics: hasConfig(playerOptions.cloudinaryAnalytics), |
101 | 99 | controls: playerOptions.controls, |
102 | 100 | floatingWhenNotVisible: playerOptions.floatingWhenNotVisible, |
103 | 101 | fluid: playerOptions.fluid, |
@@ -126,8 +124,8 @@ export const getAnalyticsFromPlayerOptions = (playerOptions) => filterDefaultsAn |
126 | 124 | debug: playerOptions.debug, |
127 | 125 | type: playerOptions.type, |
128 | 126 |
|
129 | | - colors: playerOptions.colors && JSON.stringify(playerOptions.colors), |
130 | | - controlBar: (JSON.stringify(playerOptions.controlBar) !== JSON.stringify(defaults.controlBar)) && JSON.stringify(playerOptions.controlBar), |
| 127 | + colors: hasConfig(playerOptions.colors), |
| 128 | + controlBar: hasConfig(playerOptions.controlBar), |
131 | 129 |
|
132 | 130 | ...getSourceOptions(playerOptions.sourceOptions || {}), |
133 | 131 | ...getAdsOptions(playerOptions.ads), |
|
0 commit comments