1(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.GreenAudioPlayer = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 2"use strict"; 3 4module.exports = require('./src/js/main').default; 5 6},{"./src/js/main":2}],2:[function(require,module,exports){ 7"use strict"; 8 9Object.defineProperty(exports, "__esModule", { 10 value: true 11}); 12exports.default = void 0; 13 14function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } 15 16function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } 17 18function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } 19 20function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 21 22function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 23 24function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 25 26function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 27 28var GreenAudioPlayer = /*#__PURE__*/function () { 29 function GreenAudioPlayer(player, options) { 30 _classCallCheck(this, GreenAudioPlayer); 31 32 this.audioPlayer = typeof player === 'string' ? document.querySelector(player) : player; 33 var opts = options || {}; 34 var audioElement = this.audioPlayer.innerHTML; 35 this.audioPlayer.classList.add('green-audio-player'); 36 this.audioPlayer.innerHTML = GreenAudioPlayer.getTemplate() + audioElement; 37 this.isDevice = /ipad|iphone|ipod|android/i.test(window.navigator.userAgent.toLowerCase()) && !window.MSStream; 38 this.playPauseBtn = this.audioPlayer.querySelector('.play-pause-btn'); 39 this.loading = this.audioPlayer.querySelector('.loading'); 40 this.sliders = this.audioPlayer.querySelectorAll('.slider'); 41 this.progress = this.audioPlayer.querySelector('.controls__progress'); 42 this.volumeBtn = this.audioPlayer.querySelector('.volume__button'); 43 this.volumeControls = this.audioPlayer.querySelector('.volume__controls'); 44 this.volumeProgress = this.volumeControls.querySelector('.volume__progress'); 45 this.player = this.audioPlayer.querySelector('audio'); 46 this.currentTime = this.audioPlayer.querySelector('.controls__current-time'); 47 this.totalTime = this.audioPlayer.querySelector('.controls__total-time'); 48 this.speaker = this.audioPlayer.querySelector('.volume__speaker'); 49 this.download = this.audioPlayer.querySelector('.download'); 50 this.downloadLink = this.audioPlayer.querySelector('.download__link'); 51 this.span = this.audioPlayer.querySelectorAll('.message__offscreen'); 52 this.svg = this.audioPlayer.getElementsByTagName('svg'); 53 this.img = this.audioPlayer.getElementsByTagName('img'); 54 this.draggableClasses = ['pin']; 55 this.currentlyDragged = null; 56 this.stopOthersOnPlay = opts.stopOthersOnPlay || false; 57 this.enableKeystrokes = true; 58 this.showTooltips = opts.showTooltips || false; 59 var self = this; 60 this.labels = { 61 volume: { 62 open: 'Open Volume Controls', 63 close: 'Close Volume Controls' 64 }, 65 pause: 'Pause', 66 play: 'Play', 67 download: 'Download' 68 }; 69 70 if (!this.enableKeystrokes) { 71 for (var i = 0; i < this.span.length; i++) { 72 this.span[i].outerHTML = ''; 73 } 74 } else { 75 window.addEventListener('keydown', this.pressKb.bind(self), false); 76 window.addEventListener('keyup', this.unPressKb.bind(self), false); 77 //this.playPauseBtn.setAttribute('tabindex', 0); 78 this.sliders[0].setAttribute('tabindex', 0); 79 this.sliders[1].setAttribute('tabindex', 0); 80 this.download.setAttribute('tabindex', -1); 81 this.downloadLink.setAttribute('tabindex', -1); 82 83 for (var j = 0; j < this.svg.length; j++) { 84 this.svg[j].setAttribute('tabindex', 0); 85 this.svg[j].setAttribute('focusable', true); 86 } 87 88 for (var k = 0; k < this.img.length; k++) { 89 this.img[k].setAttribute('tabindex', 0); 90 } 91 } 92 93 if (this.showTooltips) { 94 this.playPauseBtn.setAttribute('title', this.labels.play); 95 this.volumeBtn.setAttribute('title', this.labels.volume.open); 96 this.downloadLink.setAttribute('title', this.labels.download); 97 } 98 99 if (opts.outlineControls || false) { 100 this.audioPlayer.classList.add('player-accessible'); 101 } 102 103 if (opts.showDownloadButton || false) { 104 this.showDownload(); 105 } 106 107 this.initEvents(); 108 this.directionAware(); 109 this.overcomeIosLimitations(); 110 111 if ('autoplay' in this.player.attributes) { 112 var promise = this.player.play(); 113 114 if (promise !== undefined) { 115 promise.then(function () { 116 var playPauseButton = self.player.parentElement.querySelector('.play-pause-btn__icon'); 117 playPauseButton.attributes.d.value = 'M0 0h6v24H0zM12 0h6v24h-6z'; 118 self.playPauseBtn.setAttribute('aria-label', self.labels.pause); 119 self.hasSetAttribute(self.playPauseBtn, 'title', self.labels.pause); 120 }).catch(function () { 121 // eslint-disable-next-line no-console 122 console.error('Green Audio Player Error: Autoplay has been prevented, because it is not allowed by this browser.'); 123 }); 124 } 125 } 126 127 if ('preload' in this.player.attributes && this.player.attributes.preload.value === 'none') { 128 this.playPauseBtn.style.visibility = 'visible'; 129 this.loading.style.visibility = 'hidden'; 130 } 131 } 132 133 _createClass(GreenAudioPlayer, [{ 134 key: "initEvents", 135 value: function initEvents() { 136 var self = this; 137 self.audioPlayer.addEventListener('mousedown', function (event) { 138 if (self.isDraggable(event.target)) { 139 self.currentlyDragged = event.target; 140 var handleMethod = self.currentlyDragged.dataset.method; 141 var listener = self[handleMethod].bind(self); 142 window.addEventListener('mousemove', listener, false); 143 144 if (self.currentlyDragged.parentElement.parentElement === self.sliders[0]) { 145 self.paused = self.player.paused; 146 if (self.paused === false) self.togglePlay(); 147 } 148 149 window.addEventListener('mouseup', function () { 150 if (self.currentlyDragged !== false && self.currentlyDragged.parentElement.parentElement === self.sliders[0] && self.paused !== self.player.paused) { 151 self.togglePlay(); 152 } 153 154 self.currentlyDragged = false;
155 window.removeEventListener('mousemove', listener, false); 156 }, false); 157 } 158 }); // for mobile touches 159 160 self.audioPlayer.addEventListener('touchstart', function (event) { 161 if (self.isDraggable(event.target)) { 162 var _event$targetTouches = _slicedToArray(event.targetTouches, 1); 163 164 self.currentlyDragged = _event$targetTouches[0]; 165 var handleMethod = self.currentlyDragged.target.dataset.method; 166 var listener = self[handleMethod].bind(self); 167 window.addEventListener('touchmove', listener, false); 168 169 if (self.currentlyDragged.parentElement.parentElement === self.sliders[0]) { 170 self.paused = self.player.paused; 171 if (self.paused === false) self.togglePlay(); 172 } 173 174 window.addEventListener('touchend', function () { 175 if (self.currentlyDragged !== false && self.currentlyDragged.parentElement.parentElement === self.sliders[0] && self.paused !== self.player.paused) { 176 self.togglePlay(); 177 } 178 179 self.currentlyDragged = false; 180 window.removeEventListener('touchmove', listener, false); 181 }, false); 182 event.preventDefault(); 183 } 184 }); 185 this.playPauseBtn.addEventListener('click', this.togglePlay.bind(self)); 186 this.player.addEventListener('timeupdate', this.updateProgress.bind(self)); 187 this.player.addEventListener('volumechange', this.updateVolume.bind(self)); 188 this.player.volume = 0.81; 189 this.player.addEventListener('loadedmetadata', function () { 190 self.totalTime.textContent = GreenAudioPlayer.formatTime(self.player.duration); 191 }); 192 this.player.addEventListener('seeking', this.showLoadingIndicator.bind(self)); 193 this.player.addEventListener('seeked', this.hideLoadingIndicator.bind(self)); 194 this.player.addEventListener('canplay', this.hideLoadingIndicator.bind(self)); 195 this.player.addEventListener('ended', function () { 196 GreenAudioPlayer.pausePlayer(self.player, 'ended'); 197 self.player.currentTime = 0; 198 self.playPauseBtn.setAttribute('aria-label', self.labels.play); 199 self.hasSetAttribute(self.playPauseBtn, 'title', self.labels.play); 200 }); 201 this.volumeBtn.addEventListener('click', this.showHideVolume.bind(self)); 202 window.addEventListener('resize', self.directionAware.bind(self)); 203 window.addEventListener('scroll', self.directionAware.bind(self)); 204 205 for (var i = 0; i < this.sliders.length; i++) { 206 var pin = this.sliders[i].querySelector('.pin'); 207 this.sliders[i].addEventListener('click', self[pin.dataset.method].bind(self)); 208 } 209 210 this.downloadLink.addEventListener('click', this.downloadAudio.bind(self)); 211 } 212 }, { 213 key: "overcomeIosLimitations", 214 value: function overcomeIosLimitations() { 215 var self = this; 216 217 if (this.isDevice) { 218 // iOS does not support "canplay" event 219 this.player.addEventListener('loadedmetadata', this.hideLoadingIndicator.bind(self)); // iOS does not let "volume" property to be set programmatically 220 221 this.audioPlayer.querySelector('.volume').style.display = 'none'; 222 this.audioPlayer.querySelector('.controls').style.marginRight = '0'; 223 } 224 } 225 }, { 226 key: "isDraggable", 227 value: function isDraggable(el) { 228 var canDrag = false; 229 if (typeof el.classList === 'undefined') return false; // fix for IE 11 not supporting classList on SVG elements 230 231 for (var i = 0; i < this.draggableClasses.length; i++) { 232 if (el.classList.contains(this.draggableClasses[i])) { 233 canDrag = true; 234 } 235 } 236 237 return canDrag; 238 } 239 }, { 240 key: "inRange", 241 value: function inRange(event) { 242 var touch = 'touches' in event; // instanceof TouchEvent may also be used 243 244 var rangeBox = this.getRangeBox(event); 245 var sliderPositionAndDimensions = rangeBox.getBoundingClientRect(); 246 var direction = rangeBox.dataset.direction; 247 var min = null; 248 var max = null; 249 250 if (direction === 'horizontal') { 251 min = sliderPositionAndDimensions.x; 252 max = min + sliderPositionAndDimensions.width; 253 var clientX = touch ? event.touches[0].clientX : event.clientX; 254 if (clientX < min || clientX > max) return false;
255 } else { 256 min = sliderPositionAndDimensions.top; 257 max = min + sliderPositionAndDimensions.height; 258 var clientY = touch ? event.touches[0].clientY : event.clientY; 259 if (clientY < min || clientY > max) return false; 260 } 261 262 return true; 263 } 264 }, { 265 key: "updateProgress", 266 value: function updateProgress() { 267 var current = this.player.currentTime; 268 var percent = current / this.player.duration * 100; 269 this.progress.setAttribute('aria-valuenow', percent); 270 this.progress.style.width = "".concat(percent, "%"); 271 this.currentTime.textContent = GreenAudioPlayer.formatTime(current); 272 } 273 }, { 274 key: "updateVolume", 275 value: function updateVolume() { 276 this.volumeProgress.setAttribute('aria-valuenow', this.player.volume * 100); 277 this.volumeProgress.style.height = "".concat(this.player.volume * 100, "%"); 278 279 if (this.player.volume >= 0.5) { 280 this.speaker.attributes.d.value = 'M14.667 0v2.747c3.853 1.146 6.666 4.72 6.666 8.946 0 4.227-2.813 7.787-6.666 8.934v2.76C20 22.173 24 17.4 24 11.693 24 5.987 20 1.213 14.667 0zM18 11.693c0-2.36-1.333-4.386-3.333-5.373v10.707c2-.947 3.333-2.987 3.333-5.334zm-18-4v8h5.333L12 22.36V1.027L5.333 7.693H0z'; 281 } else if (this.player.volume < 0.5 && this.player.volume > 0.05) { 282 this.speaker.attributes.d.value = 'M0 7.667v8h5.333L12 22.333V1L5.333 7.667M17.333 11.373C17.333 9.013 16 6.987 14 6v10.707c2-.947 3.333-2.987 3.333-5.334z'; 283 } else if (this.player.volume <= 0.05) { 284 this.speaker.attributes.d.value = 'M0 7.667v8h5.333L12 22.333V1L5.333 7.667'; 285 } 286 } 287 }, { 288 key: "getRangeBox", 289 value: function getRangeBox(event) { 290 var rangeBox = event.target; 291 var el = this.currentlyDragged; 292 293 if (event.type === 'click' && this.isDraggable(event.target)) { 294 rangeBox = event.target.parentElement.parentElement; 295 } 296 297 if (event.type === 'mousemove') { 298 rangeBox = el.parentElement.parentElement; 299 } 300 301 if (event.type === 'touchmove') { 302 rangeBox = el.target.parentElement.parentElement; 303 } 304 305 return rangeBox; 306 } 307 }, { 308 key: "getCoefficient", 309 value: function getCoefficient(event) { 310 var touch = 'touches' in event; // instanceof TouchEvent may also be used 311 312 var slider = this.getRangeBox(event); 313 var sliderPositionAndDimensions = slider.getBoundingClientRect(); 314 var K = 0; 315 316 if (slider.dataset.direction === 'horizontal') { 317 // if event is touch 318 var clientX = touch ? event.touches[0].clientX : event.clientX; 319 var offsetX = clientX - sliderPositionAndDimensions.left; 320 var width = sliderPositionAndDimensions.width; 321 K = offsetX / width; 322 } else if (slider.dataset.direction === 'vertical') { 323 var height = sliderPositionAndDimensions.height; 324 var clientY = touch ? event.touches[0].clientY : event.clientY; 325 var offsetY = clientY - sliderPositionAndDimensions.top; 326 K = 1 - offsetY / height; 327 } 328 329 return K; 330 } 331 }, { 332 key: "rewind", 333 value: function rewind(event) { 334 if (this.player.seekable && this.player.seekable.length) { 335 // no seek if not (pre)loaded 336 if (this.inRange(event)) { 337 this.player.currentTime = this.player.duration * this.getCoefficient(event); 338 } 339 } 340 } 341 }, { 342 key: "showVolume", 343 value: function showVolume() { 344 if (this.volumeBtn.getAttribute('aria-attribute') === this.labels.volume.open) { 345 this.volumeControls.classList.remove('hidden'); 346 this.volumeBtn.classList.add('open'); 347 this.volumeBtn.setAttribute('aria-label', this.labels.volume.close); 348 this.hasSetAttribute(this.volumeBtn, 'title', this.labels.volume.close); 349 } 350 } 351 }, { 352 key: "showHideVolume", 353 value: function showHideVolume() { 354 this.volumeControls.classList.toggle('hidden'); 355 356 if (this.volumeBtn.getAttribute('aria-label') === this.labels.volume.open) { 357 this.volumeBtn.setAttribute('aria-label', this.labels.volume.close); 358 this.hasSetAttribute(this.volumeBtn, 'title', this.labels.volume.close); 359 this.volumeBtn.classList.add('open'); 360 } else { 361 this.volumeBtn.setAttribute('aria-label', this.labels.volume.open); 362 this.hasSetAttribute(this.volumeBtn, 'title', this.labels.volume.open); 363 this.volumeBtn.classList.remove('open'); 364 } 365 } 366 }, { 367 key: "changeVolume", 368 value: function changeVolume(event) { 369 if (this.inRange(event)) { 370 this.player.volume = Math.round(this.getCoefficient(event) * 50) / 50; 371 } 372 } 373 }, { 374 key: "preloadNone", 375 value: function preloadNone() { 376 var self = this; 377 378 if (!this.player.duration) { 379 self.playPauseBtn.style.visibility = 'hidden'; 380 self.loading.style.visibility = 'visible'; 381 } 382 } 383 }, { 384 key: "togglePlay", 385 value: function togglePlay() { 386 this.preloadNone(); 387 388 if (this.player.paused) { 389 if (this.stopOthersOnPlay) { 390 GreenAudioPlayer.stopOtherPlayers(); 391 } 392 393 GreenAudioPlayer.playPlayer(this.player); 394 this.playPauseBtn.setAttribute('aria-label', this.labels.pause); 395 this.hasSetAttribute(this.playPauseBtn, 'title', this.labels.pause); 396 } else { 397 GreenAudioPlayer.pausePlayer(this.player, 'toggle'); 398 this.playPauseBtn.setAttribute('aria-label', this.labels.play); 399 this.hasSetAttribute(this.playPauseBtn, 'title', this.labels.play); 400 } 401 } 402 }, { 403 key: "hasSetAttribute", 404 value: function hasSetAttribute(el, a, v) { 405 if (this.showTooltips) { 406 if (el.hasAttribute(a)) { 407 el.setAttribute(a, v); 408 } 409 } 410 } 411 }, { 412 key: "setCurrentTime", 413 value: function setCurrentTime(time) { 414 var pos = this.player.currentTime; 415 var end = Math.floor(this.player.duration); 416 417 if (pos + time < 0 && pos === 0) { 418 this.player.currentTime = this.player.currentTime; 419 } else if (pos + time < 0) { 420 this.player.currentTime = 0; 421 } else if (pos + time > end) { 422 this.player.currentTime = end; 423 } else { 424 this.player.currentTime += time; 425 } 426 } 427 }, { 428 key: "setVolume", 429 value: function setVolume(volume) { 430 if (this.isDevice) return; 431 var vol = this.player.volume; 432 433 if (vol + volume >= 0 && vol + volume < 1) { 434 this.player.volume += volume; 435 } else if (vol + volume <= 0) { 436 this.player.volume = 0; 437 } else { 438 this.player.volume = 1; 439 } 440 } 441 }, { 442 key: "unPressKb", 443 value: function unPressKb(event) { 444 var evt = event || window.event; 445 446 if (this.seeking && (evt.keyCode === 37 || evt.keyCode === 39)) { 447 this.togglePlay(); 448 this.seeking = false;
449 } 450 } 451 }, { 452 key: "pressKb", 453 value: function pressKb(event) { 454 var evt = event || window.event; 455 456 switch (evt.keyCode) { 457 case 13: // Enter 458 459 case 32: 460 // Spacebar 461 if (document.activeElement.parentNode === this.playPauseBtn) { 462 this.togglePlay(); 463 } else if (document.activeElement.parentNode === this.volumeBtn || document.activeElement === this.sliders[1]) { 464 if (document.activeElement === this.sliders[1]) { 465 try { 466 // IE 11 not supporting programmatic focus on svg elements 467 this.volumeBtn.children[0].focus(); 468 } catch (error) { 469 this.volumeBtn.focus(); 470 } 471 } 472 473 this.showHideVolume(); 474 } 475 476 if (evt.keyCode === 13 && this.showDownload && document.activeElement.parentNode === this.downloadLink) { 477 this.downloadLink.focus(); 478 } 479 480 break; 481 482 case 37: 483 case 39: 484 // horizontal Arrows 485 if (document.activeElement === this.sliders[0]) { 486 if (evt.keyCode === 37) { 487 this.setCurrentTime(-5); 488 } else { 489 this.setCurrentTime(+5); 490 } 491 492 if (!this.player.paused && this.player.seeking) { 493 this.togglePlay(); 494 this.seeking = true; 495 } 496 } 497 498 break; 499 500 case 38: 501 case 40: 502 // vertical Arrows 503 if (document.activeElement.parentNode === this.volumeBtn || document.activeElement === this.sliders[1]) { 504 if (evt.keyCode === 38) { 505 this.setVolume(0.05); 506 } else { 507 this.setVolume(-0.05); 508 } 509 } 510 511 if (document.activeElement.parentNode === this.volumeBtn) { 512 this.showVolume(); 513 } 514 515 break; 516 517 default: 518 break; 519 } 520 } 521 }, { 522 key: "showLoadingIndicator", 523 value: function showLoadingIndicator() { 524 this.playPauseBtn.style.visibility = 'hidden'; 525 this.loading.style.visibility = 'visible'; 526 } 527 }, { 528 key: "hideLoadingIndicator", 529 value: function hideLoadingIndicator() { 530 this.playPauseBtn.style.visibility = 'visible'; 531 this.loading.style.visibility = 'hidden'; 532 } 533 }, { 534 key: "showDownload", 535 value: function showDownload() { 536 this.download.style.display = 'block'; 537 } 538 }, { 539 key: "downloadAudio", 540 value: function downloadAudio() { 541 var src = this.player.currentSrc; 542 var name = src.split('/').reverse()[0]; 543 this.downloadLink.setAttribute('href', src); 544 this.downloadLink.setAttribute('download', name); 545 } 546 }, { 547 key: "directionAware", 548 value: function directionAware() { 549 this.volumeControls.classList.remove('top', 'middle', 'bottom'); 550 551 if (window.innerHeight < 250) { 552 this.volumeControls.classList.add('middle'); 553 } else if (this.audioPlayer.getBoundingClientRect().top < 180) { 554 this.volumeControls.classList.add('bottom'); 555 } else { 556 this.volumeControls.classList.add('top'); 557 } 558 } 559 }], [{ 560 key: "init", 561 value: function init(options) { 562 var players = document.querySelectorAll(options.selector); 563 players.forEach(function (player) { 564 /* eslint-disable no-new */ 565 new GreenAudioPlayer(player, options); 566 }); 567 } 568 }, { 569 key: "getTemplate", 570 value: function getTemplate() { 571 return "\n <div class=\"holder\">\n <div class=\"loading\">\n <div class=\"loading__spinner\"></div>\n </div>\n\n <div class=\"play-pause-btn\" aria-label=\"Play\" role=\"button\">\n <svg aria-label=\"Appuyez sur la touche retour à la ligne ou la touche espace pour écouter ou mettre en pause\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"24\" viewBox=\"0 0 18 24\">\n <path fill=\"#fff\" fill-rule=\"evenodd\" d=\"M18 12L0 24V0\" class=\"play-pause-btn__icon\"/>\n </svg>\n </div>\n </div>\n\n <div class=\"controls\">
571\n <span class=\"controls__current-time\" aria-live=\"off\" role=\"timer\">00:00</span>\n <div class=\"controls__slider slider\" data-direction=\"horizontal\">\n <div class=\"controls__progress gap-progress\" aria-label=\"Time Slider\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\" role=\"slider\">\n <div class=\"pin progress__pin\" data-method=\"rewind\"></div>\n </div>\n </div>\n <span class=\"controls__total-time\">00:00</span>\n </div>\n\n <div class=\"volume\">\n <div class=\"volume__button\" aria-label=\"Open Volume Controls\" role=\"button\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path class=\"volume__speaker\" fill=\"#fff\" fill-rule=\"evenodd\" d=\"M14.667 0v2.747c3.853 1.146 6.666 4.72 6.666 8.946 0 4.227-2.813 7.787-6.666 8.934v2.76C20 22.173 24 17.4 24 11.693 24 5.987 20 1.213 14.667 0zM18 11.693c0-2.36-1.333-4.386-3.333-5.373v10.707c2-.947 3.333-2.987 3.333-5.334zm-18-4v8h5.333L12 22.36V1.027L5.333 7.693H0z\"/>\n </svg>\n <span class=\"message__offscreen\">Press Enter or Space to show volume slider.</span>\n </div>\n <div class=\"volume__controls hidden\">\n <div class=\"volume__slider slider\" data-direction=\"vertical\">\n <div class=\"volume__progress gap-progress\" aria-label=\"Volume Slider\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"81\" role=\"slider\">\n <div class=\"pin volume__pin\" data-method=\"changeVolume\"></div>\n </div>\n <span class=\"message__offscreen\">Use Up/Down Arrow keys to increase or decrease volume.</span>\n </div>\n </div>\n </div>\n\n <div class=\"download\">\n <a class=\"download__link\" href=\"\" download=\"\" aria-label=\"Download\" role=\"button\">\n <svg width=\"24\" height=\"24\" fill=\"#fff\" enable-background=\"new 0 0 29.978 29.978\" version=\"1.1\" viewBox=\"0 0 29.978 29.978\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m25.462 19.105v6.848h-20.947v-6.848h-4.026v8.861c0 1.111 0.9 2.012 2.016 2.012h24.967c1.115 0 2.016-0.9 2.016-2.012v-8.861h-4.026z\"/>\n <path d=\"m14.62 18.426l-5.764-6.965s-0.877-0.828 0.074-0.828 3.248 0 3.248 0 0-0.557 0-1.416v-8.723s-0.129-0.494 0.615-0.494h4.572c0.536 0 0.524 0.416 0.524 0.416v8.742 1.266s1.842 0 2.998 0c1.154 0 0.285 0.867 0.285 0.867s-4.904 6.51-5.588 7.193c-0.492 0.495-0.964-0.058-0.964-0.058z\"/>\n </svg>\n </a>\n </div>\n "; 572 } 573 }, { 574 key: "formatTime", 575 value: function formatTime(time) { 576 var min = Math.floor(time / 60); 577 var sec = Math.floor(time % 60); 578 return "".concat(min < 10 ? "0".concat(min) : min, ":").concat(sec < 10 ? "0".concat(sec) : sec); 579 } 580 }, { 581 key: "pausePlayer", 582 value: function pausePlayer(player) { 583 var playPauseButton = player.parentElement.querySelector('.play-pause-btn__icon'); 584 playPauseButton.attributes.d.value = 'M18 12L0 24V0'; 585 player.pause(); 586 } 587 }, { 588 key: "playPlayer", 589 value: function playPlayer(player) { 590 var playPauseButton = player.parentElement.querySelector('.play-pause-btn__icon'); 591 playPauseButton.attributes.d.value = 'M0 0h6v24H0zM12 0h6v24h-6z'; 592 player.play(); 593 } 594 }, { 595 key: "stopOtherPlayers", 596 value: function stopOtherPlayers() { 597 var players = document.querySelectorAll('.green-audio-player audio'); 598 599 for (var i = 0; i < players.length; i++) { 600 GreenAudioPlayer.pausePlayer(players[i]); 601 } 602 } 603 }]); 604 605 return GreenAudioPlayer; 606}(); 607 608var _default = GreenAudioPlayer; 609exports.default = _default; 610 611},{}]},{},[1])(1) 612});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.