Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(analytics): add support for tracking control
Add support for the `trackers` property to the `player.options` in order to store tracker instances. This makes it easier to access trackers directly from the player. Use of this feature remains optional. ```javascript // add custom tracker const player = new Pillarbox('my-player', { trackers: { customTracker: new CustomTracker(player), anotherTracker: new AnotherTracker(player), } }) ``` Add the ability to disable trackers per playback session by introducing the `disableTrackers` property provided directly to the `player.src`. As most trackers take an instance of the player as a parameter. This will make it easier to access the disableTrackers property to determine whether or not the tracker should be disabled for the current playback session. ```javascript // disable a tracker for the playback session player.src({ src : 'urn:xyz', type: 'srgssr/urn', disableTrackers : ['anotherTracker'] }); // disable all trackers for the playback session player.src({ src : 'urn:xyz', type: 'srgssr/urn', disableTrackers : true }) ``` Add support for SRG SSR-compliant media playback tracking. - add `trackers` to Pillarbox default options - add the `SRGAnalytics` class and unit tests - add `PlayerEvents` that contains all `mediaElement` events - srgssr middleware - add a function to handle SRG SSR analytics - update `composeSrcMediaData` to handle `disableTrackers` - move the construction of the main resources array into its own function - update unit tests Refers to issue #32
- Loading branch information