1export const controller = async () => { 2 const supported = 'audioSession' in navigator; 3 const audiosessionState = document.querySelector('#audiosession-state'); 4 5 if(!supported) { 6 (document.querySelector(`.no-support`) || 7 document.querySelector(`[data-view="${location.pathname}"] .no-support`)).style.display = 'block'; 8 } 9 10 if(supported) { 11 const audioSessionType = document.querySelector('[name="audiosession-type"]'); 12 13 audioSessionType.addEventListener('change', ({target}) => { 14 navigator.audioSession.type = target.value; 15 audiosessionState.textContent = navigator.audioSession.state; 16 }); 17 18 navigator.audioSession.addEventListener('statechange', (e) => { 19 console.log(e, navigator.audioSession.state); 20 audiosessionState.textContent = navigator.audioSession.state; 21 }); 22 23 audiosessionState.textContent = navigator.audioSession.state; 24 } 25}
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.