In my expectation, I wish to use MutationObserver to listen to the event that tells the video has loaded. The reason for that is I need to add a loading animation before the video has been rendered and loaded in the DOM, then remove the animation when the video showed on the page. It seems that MutationObserver couldn't tell the time when the video loaded, it only knows the attributes changed.
Below is my code:
const callback = () => {
console.log('done')
}
const observer = new MutationObserver(callback)
this.observer.observe(videoNode, {
attributes: true
})