Skip to content

Commit

Permalink
Bug Issue greghub#30 patch
Browse files Browse the repository at this point in the history
Patch for play-pause-btn aria-label="Play" issue greghub#30
  • Loading branch information
tnbnicer committed Aug 21, 2021
1 parent e3b305f commit ac36450
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 8 additions & 1 deletion dist/js/green-audio-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var GreenAudioPlayer = /*#__PURE__*/function () {
var audioElement = this.audioPlayer.innerHTML;
this.audioPlayer.classList.add('green-audio-player');
this.audioPlayer.innerHTML = GreenAudioPlayer.getTemplate() + audioElement;
this.isDevice = /ipad|iphone|ipod|android/i.test(window.navigator.userAgent.toLowerCase()) && !window.MSStream;
this.isDevice = (/ipad|iphone|ipod|android/i.test(window.navigator.userAgent.toLowerCase()) || window.navigator.platform === 'MacIntel' && window.navigator.maxTouchPoints > 1) && !window.MSStream;
this.playPauseBtn = this.audioPlayer.querySelector('.play-pause-btn');
this.loading = this.audioPlayer.querySelector('.loading');
this.sliders = this.audioPlayer.querySelectorAll('.slider');
Expand Down Expand Up @@ -597,6 +597,13 @@ var GreenAudioPlayer = /*#__PURE__*/function () {

for (var i = 0; i < players.length; i++) {
GreenAudioPlayer.pausePlayer(players[i]);
var holderDiv = players[i].parentElement.querySelector('.holder');
var playPauseBtn = holderDiv.querySelector('.play-pause-btn');
playPauseBtn.setAttribute('aria-label', 'Play');

if (playPauseBtn.attributes.title) {
playPauseBtn.setAttribute('title', 'Play');
}
}
}
}]);
Expand Down
Loading

0 comments on commit ac36450

Please sign in to comment.