Skip to content

Commit 83e36cc

Browse files
authored
fix: internal analytics (#917)
* fix: allowUsageReport * fix: add interactionAreas * fix: align shoppableProductsLength with shoppable * fix: allowUsageReport
1 parent 68abf29 commit 83e36cc

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/utils/get-analytics-player-options.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ const getSourceOptions = (sourceOptions = {}) => ({
3131
abrStrategy: sourceOptions?.adaptiveStreaming?.strategy === defaults.adaptiveStreaming.strategy ? undefined : sourceOptions?.adaptiveStreaming?.strategy,
3232
} : {}),
3333
shoppable: hasConfig(sourceOptions.shoppable),
34-
shoppableProductsLength: sourceOptions.shoppable && sourceOptions.shoppable.products && sourceOptions.shoppable.products.length,
34+
shoppableProductsLength: hasConfig(sourceOptions.shoppable) && sourceOptions.shoppable.products.length,
3535
...(sourceOptions.title || sourceOptions.description || sourceOptions.info ? {
3636
sourceInfo: hasConfig(sourceOptions.info),
3737
sourceTitle: (typeof sourceOptions.title === 'string' ? sourceOptions.title : sourceOptions.info?.title),
3838
sourceDescription: (typeof sourceOptions.description === 'string' ? sourceOptions.description : sourceOptions.info?.subtitle || sourceOptions.info?.description)
3939
} : {}),
4040
...(hasConfig(sourceOptions.textTracks) ? getTextTracksOptions(sourceOptions.textTracks) : {}),
41+
interactionAreas: hasConfig(sourceOptions.interactionAreas),
4142
videoSources: !!sourceOptions.videoSources,
4243
});
4344

src/video-player.const.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Parameters that can be passed to source configuration (inherited by source method)
22
export const SOURCE_PARAMS = [
33
'adaptiveStreaming',
4+
'allowUsageReport',
45
'autoShowRecommendations',
56
'chapters',
67
'cloudinaryConfig',
@@ -32,7 +33,6 @@ export const PLAYER_PARAMS = SOURCE_PARAMS.concat([
3233
'_internalAnalyticsMetadata',
3334
'ads',
3435
'aiHighlightsGraph',
35-
'allowUsageReport',
3636
'analytics',
3737
'autoplayMode',
3838
'chaptersButton',

src/video-player.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class VideoPlayer extends Utils.mixin(Eventable) {
106106

107107
_sendInternalAnalytics(additionalOptions = {}) {
108108
const options = Object.assign({}, this.playerOptions, this.options.videojsOptions, additionalOptions);
109-
if (!options.allowUsageReport) {
109+
if (!options.sourceOptions?.allowUsageReport) {
110110
return;
111111
}
112112
try {

0 commit comments

Comments
 (0)