diff --git a/src/utils/get-analytics-player-options.js b/src/utils/get-analytics-player-options.js index 3a2bce7e..1b59d01f 100644 --- a/src/utils/get-analytics-player-options.js +++ b/src/utils/get-analytics-player-options.js @@ -31,13 +31,14 @@ const getSourceOptions = (sourceOptions = {}) => ({ abrStrategy: sourceOptions?.adaptiveStreaming?.strategy === defaults.adaptiveStreaming.strategy ? undefined : sourceOptions?.adaptiveStreaming?.strategy, } : {}), shoppable: hasConfig(sourceOptions.shoppable), - shoppableProductsLength: sourceOptions.shoppable && sourceOptions.shoppable.products && sourceOptions.shoppable.products.length, + shoppableProductsLength: hasConfig(sourceOptions.shoppable) && sourceOptions.shoppable.products.length, ...(sourceOptions.title || sourceOptions.description || sourceOptions.info ? { sourceInfo: hasConfig(sourceOptions.info), sourceTitle: (typeof sourceOptions.title === 'string' ? sourceOptions.title : sourceOptions.info?.title), sourceDescription: (typeof sourceOptions.description === 'string' ? sourceOptions.description : sourceOptions.info?.subtitle || sourceOptions.info?.description) } : {}), ...(hasConfig(sourceOptions.textTracks) ? getTextTracksOptions(sourceOptions.textTracks) : {}), + interactionAreas: hasConfig(sourceOptions.interactionAreas), videoSources: !!sourceOptions.videoSources, }); diff --git a/src/video-player.const.js b/src/video-player.const.js index efe9fb3f..ee437dc5 100644 --- a/src/video-player.const.js +++ b/src/video-player.const.js @@ -1,6 +1,7 @@ // Parameters that can be passed to source configuration (inherited by source method) export const SOURCE_PARAMS = [ 'adaptiveStreaming', + 'allowUsageReport', 'autoShowRecommendations', 'chapters', 'cloudinaryConfig', @@ -32,7 +33,6 @@ export const PLAYER_PARAMS = SOURCE_PARAMS.concat([ '_internalAnalyticsMetadata', 'ads', 'aiHighlightsGraph', - 'allowUsageReport', 'analytics', 'autoplayMode', 'chaptersButton', diff --git a/src/video-player.js b/src/video-player.js index 86ad21ea..7c45c59c 100644 --- a/src/video-player.js +++ b/src/video-player.js @@ -106,7 +106,7 @@ class VideoPlayer extends Utils.mixin(Eventable) { _sendInternalAnalytics(additionalOptions = {}) { const options = Object.assign({}, this.playerOptions, this.options.videojsOptions, additionalOptions); - if (!options.allowUsageReport) { + if (!options.sourceOptions?.allowUsageReport) { return; } try {