Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playing ad metric #236

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fandom/jwplayer-fandom",
"version": "2.15.2",
"version": "2.15.3",
"description": "JWPlayer for Fandom",
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 2 additions & 0 deletions src/jwplayer/players/shared/JwPlayerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ const JwPlayerWrapper: React.FC<JwPlayerWrapperProps> = ({
VIDEO_RECORD_EVENTS.JW_PLAYER_PLAYING_CONTENT_OR_AD,
VIDEO_RECORD_EVENTS.JW_PLAYER_READY,
);

recordAndTrackDifference(VIDEO_RECORD_EVENTS.JW_PLAYER_PLAYING_AD, VIDEO_RECORD_EVENTS.JW_PLAYER_READY);
});

playerInstance.on(JWEvents.READY, (event) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ const JwPlayerWrapperWithStrategyRules: React.FC<JwPlayerWrapperProps> = ({
STRATEGY_RULES_VIDEO_RECORD_EVENTS.JW_PLAYER_READY,
);

recordAndTrackDifference(
STRATEGY_RULES_VIDEO_RECORD_EVENTS.JW_PLAYER_PLAYING_AD,
STRATEGY_RULES_VIDEO_RECORD_EVENTS.JW_PLAYER_READY,
);

const newAdIndex = adIndexRef.current + 1;
const newPrerollAdTag = updateRVParam(prerollAdTag, newAdIndex);
adIndexRef.current = newAdIndex;
Expand Down
2 changes: 2 additions & 0 deletions src/jwplayer/utils/videoTimingEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const VIDEO_RECORD_EVENTS = {
JW_PLAYER_READY: 'jw-player-ready',
JW_PLAYER_PLAYING_VIDEO_CONTENT: 'jw-player-playing-initial-video',
JW_PLAYER_PLAYING_CONTENT_OR_AD: 'jw-player-playing-content-or-ad',
JW_PLAYER_PLAYING_AD: 'jw-player-playing-ad',
};

export const STRATEGY_RULES_VIDEO_RECORD_EVENTS = {
Expand All @@ -16,6 +17,7 @@ export const STRATEGY_RULES_VIDEO_RECORD_EVENTS = {
JW_PLAYER_READY: 'jw-sr-player-ready',
JW_PLAYER_PLAYING_VIDEO_CONTENT: 'jw-sr-player-playing-initial-video',
JW_PLAYER_PLAYING_CONTENT_OR_AD: 'jw-sr-player-playing-content-or-ad',
JW_PLAYER_PLAYING_AD: 'jw-sr-player-playing-ad',
};

const recordOptions = { sampleRate: 1 };
Expand Down
Loading