FluidbookAudioPlayer.prototype = {
init: function () {
var $this = this;
- $(document).on('click', "audio:not([controls])", function () {
- console.log(this);
- if (this.paused) {
- this.play();
- $(this).addClass('playing');
+ $(document).on('click', "audio + .visualPlayer", function () {
+ var audio=$(this).prev('audio').get(0);
+ console.log(audio);
+ if (audio.paused) {
+ audio.play();
+ $(audio).addClass('playing');
} else {
- this.pause();
- $(this).removeClass('playing');
+ audio.pause();
+ $(audio).removeClass('playing');
}
return false;
});
audio {
&.invisible, &.redbull {
opacity: 0;
- cursor: pointer;
}
&.redbull {
+ .visualPlayer {
- pointer-events: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
+ cursor: pointer;
.icon {
position: absolute;
top: 7px;
left: 7px;
width: ~"calc(100% - 14px)";
- height: ~"calc(100% - 14px)";
+ height: ~"calc(100% - 14px)";
background-color: #224d8d;
border-radius: 50% 50%;
}