iOS audio output change

by juberti

HTML

<audio src="https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3" controls></audio>

JavaScript

const audio = document.querySelector('audio');
const ctx = new AudioContext();

audio.addEventListener('pause', (event) => {
  window.alert('The Boolean paused property is now true. Either the ' + 
  'pause() method was called or the autoplay attribute was toggled.');
});

ctx.addEventListener('statechange', (event) => {
  window.alert('AC statechange: ' + ctx.state);
});