From 7552998726656d83ba228460b4dc687ae9d0c94d Mon Sep 17 00:00:00 2001 From: jakub-roch <70572646+jakub-roch@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:50:01 +0100 Subject: [PATCH] fix: one event for internal analytics (#728) * fix: one event for internal analytics --- src/plugins/cloudinary/index.js | 2 +- src/video-player.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/cloudinary/index.js b/src/plugins/cloudinary/index.js index 7389881d..453c9d59 100644 --- a/src/plugins/cloudinary/index.js +++ b/src/plugins/cloudinary/index.js @@ -90,7 +90,7 @@ class CloudinaryContext { refresh(); } - this.player.trigger('cldsourcechanged', { source: src }); + this.player.trigger('cldsourcechanged', { source: src, sourceOptions: options }); return _chainTarget; }; diff --git a/src/video-player.js b/src/video-player.js index c1597415..61f1b180 100644 --- a/src/video-player.js +++ b/src/video-player.js @@ -475,8 +475,8 @@ class VideoPlayer extends Utils.mixin(Eventable) { } } - _onSourceChange() { - this._sendInternalAnalytics(); + _onSourceChange(e, { sourceOptions }) { + this._sendInternalAnalytics({ ...(sourceOptions ?? { source: sourceOptions }) }); // #if (!process.env.WEBPACK_BUILD_LIGHT) this._initQualitySelector(); // #endif @@ -541,8 +541,6 @@ class VideoPlayer extends Utils.mixin(Eventable) { }); } - this._sendInternalAnalytics({ source: options }); - if (publicId instanceof VideoSource) { return this.videojs.cloudinary.source(publicId, options); }