Overview
Vidyard players can contain more than one video to create a playlist. Sometimes you may wish to direct a contact to a particular video in a playlist, rather provide them with a link that shows a player with multiple videos which runs through all of them.
Solution
If you wish to ensure that all of the analytics are kept on the current player containing the playlist, then you can provide a link to the player's page that includes a chapter query string in the URL.
A chapter query string allows you to show a particular video in the playlist from the moment the play button is pressed.
- You can see the difference that makes here:
- No query string:
http://embed.vidyard.com/share/uEKX33rvWbjE5H735GPYiq - Query string set to chapter 2
http://embed.vidyard.com/share/uEKX33rvWbjE5H735GPYiq?chapter=2 - Query string set to chapter 3 and autoplay:
http://embed.vidyard.com/share/uEKX33rvWbjE5H735GPYiq?chapter=3&autoplay=1
- No query string:
Note: The splash-screen image is always relevant to the player and will not change if you use a chapter query string. Therefore, you may need to ensure that it is set to an image that is relevant to any of the videos in the playlist, or use autoplay to avoid them seeing it.
A query string will only work natively on the sharing page, but you can add extra javascript to perform the same thing on a page with the Responsive Embed Code.
Simply insert the code below into the head or body of the page to replicate this functionality.
<script type ="text/javascript" >
// Parsing the query string.
function get_parameter_by_name(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if (results == null) {
return "";
} else {
return results[1];
}
}
//Check Vidyard API is ready.
window.vidyardEmbed
? initApp(window.vidyardEmbed)
: (window.onVidyardAPI = (vyApi) => initApp(vyApi));
//Run function when Vidyard API is ready.
function initApp(vyApi){
//Grab the chapter number from the URL.
var playerChapter = get_parameter_by_name("chapter");
//Use the first player that's embedded in the HTML. for others, change [0] to [1] etc.
var player = VidyardV4.players[0];
var vyHasRun = false;
//If code to change chapter has already run, exit.
player.on('ready', function(){
if (vyHasRun) {
return;
}
//Conform to '0' being the first chapter.
player.playChapter(playerChapter - 1);
//Set code to 'has run' state.
vyHasRun = true;
});
};
</script>
Another solution is to Add a New Player that only contains the video that you want to send to your target audience. Once encoded, provide your viewer with a link to the new sharing page. Analytics will only be collected on this new player.
Use the scenario that is best suited to your needs.