Skip to content

Commit

Permalink
Merge pull request #152 from suvarnakale/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #PS-2753 feat : Implemention of telemetry for V1 player
  • Loading branch information
itsvick authored Dec 12, 2024
2 parents 17c7475 + 1a793bb commit 75c750f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/V1-Player/V1Player.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getTelemetryEvents } from "@/utils/Helper";
import React, { useRef, useEffect } from "react";

interface PlayerProps {
Expand All @@ -17,7 +18,10 @@ const V1Player = ({ playerConfig }: PlayerProps) => {

const handleLoad = () => {
setTimeout(() => {
if (preview.contentWindow && preview.contentWindow.initializePreview) {
if (
preview.contentWindow &&
preview.contentWindow.initializePreview
) {
preview.contentWindow.initializePreview(playerConfig);
}
preview.contentWindow.addEventListener("message", (event: any) => {
Expand All @@ -26,12 +30,13 @@ const V1Player = ({ playerConfig }: PlayerProps) => {

preview.addEventListener("renderer:telemetry:event", (event: any) => {
console.log("V1 player telemetry event ===>", event);
if (event.detail.telemetryData.eid === 'START') {
if (event.detail.telemetryData.eid === "START") {
console.log("V1 player telemetry START event ===>", event);
}
if (event.detail.telemetryData.eid === 'END') {
if (event.detail.telemetryData.eid === "END") {
console.log("V1 player telemetry END event ===>", event);
}
getTelemetryEvents(event.detail.telemetryData, "v1");
});
}, 100);
};
Expand Down

0 comments on commit 75c750f

Please sign in to comment.