简体   繁体   中英

detect sound in a webview android java

I have a webview with a web with a video. I need to detect when that video starts. it occurs to me to detect if the webview is emitting sound. Does anyone know how to do it? Thank you.

The video element has a play event:

const video = document.querySelector('video');

video.addEventListener('play', (event) => {
  console.log('The Boolean paused property is now false. Either the ' +
  'play() method was called or the autoplay attribute was toggled.');
});

source: MDN https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play_event

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM