Player SDK Instructions

Tout’s SDK video player supports basic player interactions programatically. The following is a brief guide:

 

Get all players:

var allPlayers = TOUT.players.getAll();

 

Get all players with a specific type

var topArticlePlayers = TOUT.players.byProductName(TOUT.PRODUCTS.TOP_ARTICLE);
var midArticlePlayers = TOUT.players.byProductName(TOUT.PRODUCTS.MID_ARTICLE);


Note: For the vast majority of implementations, this is just the mid article product.

 

Player Functions/Properties

 

These are the functions that can be called on the Tout Player.

play()
pause()
mute()
unmute()
tout
instanceID
productName

If you have additional functions that you’d like to request, please email david@tout.com

 

Example: Pause the mid article player

var topArticlePlayers = TOUT.players.byProductName(TOUT.PRODUCTS.MID_ARTICLE);
if(topArticlePlayers.length > 0){
  topArticlePlayers[0].pause();
}

 

Example: Get metadata for a tout

var topArticlePlayers = TOUT.players.byProductName(TOUT.PRODUCTS.MID_ARTICLE);
if(topArticlePlayers.length > 0){
  var tout = topArticlePlayers[0].tout;
  alert("User: " + tout.user.username + "; Created at: " + tout.created_at + ", Text: " + tout.text);
}

Posted in Uncategorized

Leave a Reply

Your email address will not be published. Required fields are marked *

*