Created
July 27, 2017 13:28
-
-
Save jramsahai/22389e843833d941935c85202832b4d2 to your computer and use it in GitHub Desktop.
Using the Vidyard player API to grab the Vidyard visitor ID for a given viewer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var player = new Vidyard.player(uuid); | |
var callback = function() { | |
if (!player.metadata.visitorID) { return; } | |
// We have a visitor ID, do things! | |
console.log(player.metadata.visitorID); | |
// If we only want this callback to execute exactly once: | |
callback = function() {}; | |
}; | |
player.on('ready', callback); | |
player.on('visitor', callback); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment