$('audio.redbull').each(function () {
$this.initRedbullPlayer(this);
});
+ $('audio.twostatesicon').each(function () {
+ $this.initTwoStatesIconPlayer(this);
+ });
},
arc.attr('stroke-width', sw);
},
+ initTwoStatesIconPlayer: function (player) {
+ if ($(player).find('.icon').length>0) {
+ return;
+ }
+ var vp = $(player).next('.visualPlayer');
+ if ($(player).prop('autoplay')) {
+ $(player).addClass('playing');
+ $(vp).addClass('playing');
+ }
+
+ vp.append('<div class="icon play">' + getSpriteIcon('audioplayer-play') + '</div>');
+ vp.append('<div class="icon pause">' + getSpriteIcon('audioplayer-pause') + '</div>');
+ },
initRedbullPlayer: function (player) {
var vp = $(player).next('.visualPlayer');
audio {
- &.invisible, &.redbull {
+ &.invisible, &.redbull, &.twostatesicon {
opacity: 0;
}
- &.redbull {
- + .visualPlayer {
+ + .visualPlayer {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 60px;
+ height: 60px;
+ cursor: pointer;
+ transform-origin: 0 0 0;
+
+ .icon {
position: absolute;
top: 0;
left: 0;
- width: 60px;
- height: 60px;
- cursor: pointer;
- transform-origin: 0 0 0;
+ width: 100%;
+ height: 100%;
+ color: @audioplayer-icon-color;
+ &.play {
+ display: block;
+ }
- &.playing {
- .icon {
- &.play {
- display: none;
- }
+ &.pause {
+ display: none;
+ }
+ }
- &.pause {
- display: block;
- }
+ &.playing {
+ .icon {
+ &.play {
+ display: none;
+ }
+
+ &.pause {
+ display: block;
}
}
+ }
+
+ }
+
+ &.twostatesicon {
+ + .visualPlayer {
+
+ }
+ }
+
+ &.redbull {
+ + .visualPlayer {
.icon {
position: absolute;