fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c4421d3
)
Stats for audiobooks
author
Radek Czajka
<rczajka@rczajka.pl>
Fri, 6 May 2022 12:23:25 +0000
(14:23 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Fri, 6 May 2022 12:23:25 +0000
(14:23 +0200)
src/catalogue/static/player/2022_player.js
patch
|
blob
|
history
diff --git
a/src/catalogue/static/player/2022_player.js
b/src/catalogue/static/player/2022_player.js
index
07bee41
..
c727261
100644
(file)
--- a/
src/catalogue/static/player/2022_player.js
+++ b/
src/catalogue/static/player/2022_player.js
@@
-64,27
+64,45
@@
speed = parseFloat(speedStr);
player.jPlayer("option", "playbackRate", speed);
localStorage['audiobook-speed'] = speedStr;
speed = parseFloat(speedStr);
player.jPlayer("option", "playbackRate", speed);
localStorage['audiobook-speed'] = speedStr;
+ _paq.push(['trackEvent', 'audiobook', 'speed', speedStr]);
});
});
+ $('.jp-play', $root).click(function() {
+ _paq.push(['trackEvent', 'audiobook', 'play']);
+ });
+ $('.jp-seek-bar', $root).click(function() {
+ _paq.push(['trackEvent', 'audiobook', 'seek']);
+ });
+ $('.jp-mute', $root).click(function() {
+ _paq.push(['trackEvent', 'audiobook', 'mute']);
+ });
+ $('.jp-volume-bar', $root).click(function() {
+ _paq.push(['trackEvent', 'audiobook', 'volume']);
+ });
+
$('.play-next', $root).click(function() {
let p = $currentMedia.next();
if (p.length) {
setMedia(p).jPlayer("play");
$('.play-next', $root).click(function() {
let p = $currentMedia.next();
if (p.length) {
setMedia(p).jPlayer("play");
+ _paq.push(['trackEvent', 'audiobook', 'next']);
}
});
$('.play-prev', $root).click(function() {
let p = $currentMedia.prev();
if (p.length) {
setMedia(p).jPlayer("play");
}
});
$('.play-prev', $root).click(function() {
let p = $currentMedia.prev();
if (p.length) {
setMedia(p).jPlayer("play");
+ _paq.push(['trackEvent', 'audiobook', 'prev']);
} else {
// If in first part, restart it.
setMedia($currentMedia).jPlayer("play");
} else {
// If in first part, restart it.
setMedia($currentMedia).jPlayer("play");
+ _paq.push(['trackEvent', 'audiobook', 'rewind']);
}
});
$('.jp-playlist li', $root).click(function() {
setMedia($(this)).jPlayer("play");
$('.c-player__chapters').removeClass('is-active');
}
});
$('.jp-playlist li', $root).click(function() {
setMedia($(this)).jPlayer("play");
$('.c-player__chapters').removeClass('is-active');
+ _paq.push(['trackEvent', 'audiobook', 'chapter']);
});
var initialElem = $('.jp-playlist li', $root).first();
});
var initialElem = $('.jp-playlist li', $root).first();