Skip to content

Commit

Permalink
flowplayer is not always there, so try first
Browse files Browse the repository at this point in the history
  • Loading branch information
Christos Psaltis committed Nov 17, 2011
1 parent 41cea8c commit fa628ac
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions collective/piwik/flowplayer/star.pt
Expand Up @@ -49,20 +49,29 @@ jq(function () {
setTimeout("getDownCount()",5000); setTimeout("getDownCount()",5000);
}); });



try {
$f("*").each( // if there is flowplayer track its plays
function() { $f("*").each(
this.onStart(function() { function() {
if (this.getClip().type=='video') { this.onStart(function() {
try { if (this.getClip().type=='video') {
piwikTracker.trackLink(location.href.split('/view')[0],'link'); try {
getPlayCount(); piwikTracker.trackLink(location.href.split('/view')[0],'link');
} catch( err ) { getPlayCount();
} catch( err ) { // alert('cannot track flowplayer');
}
} }
} })
}) }
} );
); } catch (err) { // alert('flowplayer is undefined');
}

/* bind play event to mediaelement
$('video').bind('play', function(){
console.info('end');
});
*/


jq('a[href$="at_download/file"]').click(function() { jq('a[href$="at_download/file"]').click(function() {
setTimeout("piwikTracker.trackLink(location.href.split('/view')[0],'download')",1000); setTimeout("piwikTracker.trackLink(location.href.split('/view')[0],'download')",1000);
Expand Down

0 comments on commit fa628ac

Please sign in to comment.