Skip to content
Browse files

flowplayer is not always there, so try first

  • Loading branch information...
1 parent 41cea8c commit fa628ac9dced091fdaaebb697a02bff0b650bb9f Christos Psaltis committed Nov 17, 2011
Showing with 22 additions and 13 deletions.
  1. +22 −13 collective/piwik/flowplayer/star.pt
View
35 collective/piwik/flowplayer/star.pt
@@ -49,20 +49,29 @@ jq(function () {
setTimeout("getDownCount()",5000);
});
-
- $f("*").each(
- function() {
- this.onStart(function() {
- if (this.getClip().type=='video') {
- try {
- piwikTracker.trackLink(location.href.split('/view')[0],'link');
- getPlayCount();
- } catch( err ) {
+ try {
+ // if there is flowplayer track its plays
+ $f("*").each(
+ function() {
+ this.onStart(function() {
+ if (this.getClip().type=='video') {
+ try {
+ piwikTracker.trackLink(location.href.split('/view')[0],'link');
+ 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() {
setTimeout("piwikTracker.trackLink(location.href.split('/view')[0],'download')",1000);

0 comments on commit fa628ac

Please sign in to comment.
Something went wrong with that request. Please try again.