From 61063664e2f861d0e45e71a4b2109c8d37422ce0 Mon Sep 17 00:00:00 2001 From: Olivier Lando Date: Tue, 30 Jul 2024 15:40:47 +0200 Subject: [PATCH] Fix custom parameters --- .npmignore | 2 ++ CHANGELOG.md | 4 ++++ index.ts | 14 +++++++------- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.npmignore b/.npmignore index 2606b51..e278d49 100644 --- a/.npmignore +++ b/.npmignore @@ -6,3 +6,5 @@ test dist/test samples/ .github/ +index.ts +jest.config.js \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 95a5681..6adeb54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All changes to this project will be documented in this file. +## [2.0.1] - 2024-07-31 + +- Fix custom parameters + ## [2.0.0] - 2024-07-31 - Switch to api.video analytics v2.0 diff --git a/index.ts b/index.ts index 4c88395..d10c0c0 100644 --- a/index.ts +++ b/index.ts @@ -36,13 +36,6 @@ export class VideoJsApiVideoAnalytics extends Plugin { (this.options as any).mediaUrl = src; this.setOptions(this.options); this.lastMediaUrl = src; - - const videoElt = this.player.el().querySelector("video"); - if (videoElt) { - this.playerAnalytics.ovbserveMedia(videoElt); - } else { - console.error("No video element found in the player"); - } } } else { this.passthrough = true; @@ -60,6 +53,13 @@ export class VideoJsApiVideoAnalytics extends Plugin { ...options, }); + const videoElt = this.player.el().querySelector("video"); + if (videoElt) { + this.playerAnalytics.ovbserveMedia(videoElt); + } else { + console.error("No video element found in the player"); + } + this.player.ready(() => { if (this.isFirstInit) { events.forEach((eventName) => diff --git a/package-lock.json b/package-lock.json index ef98e28..cb6b7a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@api.video/videojs-player-analytics", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@api.video/videojs-player-analytics", - "version": "2.0.0", + "version": "2.0.1", "license": "MIT", "dependencies": { "@api.video/player-analytics": "^2.0.0", diff --git a/package.json b/package.json index 5f3822d..52e8a75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@api.video/videojs-player-analytics", - "version": "2.0.0", + "version": "2.0.1", "description": "api.video player analytics plugin for videojs", "repository": { "type": "git",