Replies: 2 comments 2 replies
-
I guess it might be this vidstack/analytics ? |
Beta Was this translation helpful? Give feedback.
-
Not sure how to do it with third-party integrations yet because I haven't had a chance to experiment with them all yet. I'd need some clarification on what you mean by "usage" so I can help more. I'm guessing something like the amount of playback time they've consumed in a single sesssion? Do note you'd need to account for any buffering and seek events as well. We've done this before by creating a As you noted, the Vidstack Player Events can cover it. You can check if an event was dispatched by the system or user checking the const video = document.querySelector('vds-video');
video.addEventListener('vds-playing', (event) => {
if (event.isOriginTrusted) {
// user played media
} else {
// system played media (e.g., browser, or programmatic call)
}
});
Yep definitely plans to add third-party integrations. Still a big question on how we should approach them such. I haven't thought about it deeply yet but on the surface probably by creating a flexible base analytics element. The element can listen to media events, do some work, and dispatch analyitcs events such as The hope would be we can then use same base API to build out third-party integrations by simply wiring up the analytics events to their respective integration work. Need to talk to the Mux team on how to integrate with Mux Data because there's no public docs to my knowledge. |
Beta Was this translation helpful? Give feedback.
-
Hello,
Was wondering if there's any ideas on how to best integrate with third party (or custom) analytics for tracking user's usage of the player?
Eg when user click
play
, etc..I think I can probably use the Events but I wanted to check if there was a recommended pattern? and/or what could be a good way to use Events to do this? And/or if there are going to be integrations with mux/data or other providers in the future?
apologies if you might have covered this elsewhere, but so far couldn't find it
Best
Pietro
Beta Was this translation helpful? Give feedback.
All reactions