Traffic Counter API
|
Version: 1.0 | Compatible With: PlayerDIY Web Player V2.0 and up |
Updated on: Aug.14th, 2009 | Developer: PlayerDIY Software | |
Free |
Introduction:
Traffic Counter API provides easy-to-use ways to enable its users to count and display how many times a video has been viewed, and let viewers know how popular the video is.
Where Traffic Counter API appears:
After install this plugin, it will appears on the following interface of PlayerDIY Web Player.
The "Traffic Counter API " interface is for choosing a way to get the video data from player
This Traffic Counter API provides two options to get data of video from flash video player: 1. Via JS API; 2. Via URL
If choose to get video data via JS API on the above interface, the API is:
<script>
function mwplayer_counter_callback_func(idx, caption, path, playerid, date) {
alert(idx+'\n'+caption+'\n'+path+'\n'+playerid+'\n'+date);
}
</script>
If choose to get video data via URL, the API is:
http://yourdomain.com/webpage?i={index}&c={caption}&p={path}&pi={playerid}&pu={playerurl}&d={date}
Note: To get video data via URL, besides need to build a webpage (e.g.: counter.php) to get the data, but also need to build a page named crossdomain.xml and put it in the same directory with the webpage (e.g.: counter.php)
The content of crossdomain.xml as below:
<?xml version="1.0" ?>
<cross-domain-policy>
<allow-access-fromdomain="*" />
</cross-domain-policy>
Term interpretations:
* idx and index indicate the video ID in the player
* caption indicates the video name.
* path indicates the path to the video file.
* playerid indicates the player ID
* playerurl indicates the path to the player
* date indicates on which day the video was played
Tutorials about making the traffic counter build relationship with flash video player in different situations:
Situation 1: You don’t have a flash video player, and you need to customize one with PlayerDIY Web Player. In this situation, to build the relationship, you just need to check an option (JS API or URL) and click the “Submit” button on the “Traffic Counter API” interface.
Situation 2: You already have a flash video player customized with PlayerDIY Web Player. To build the relationship in this situation, you need to put a folder named “plus” (contains a plugin file counter.swf) and a file addonslist.xml in the same folder with the player files.
The “plus” folder with counter.swf and the addonslist.xml file can be easily generated with PlayerDIY Web Player. About this, please refer to situation 1
- Set control-bar color to match website
- Set background color of player
- Set the position of control bar
- Customize Preloader button
- Hide control bar automatically
- Remove the "Embed & URL" Area
- Hide mouse automatically
- Hide playing time
- Hide playlist icon
- Hide previous and next icons
- Hide playing process bar
- Customize right-click menu