The reason for the difference is that after pressing the play button (or calling the play method), the paused state is false and the play event is triggered, but this does not guarantee that the video will start playing. He is just βtryingβ to play.
If at some point the video is not enough data, then it will be paused (although paused again will be false) and the waiting event will occur. When there is enough data (and readyState greater than or equal to HAVE_FUTURE_DATA ), the playing event will occur and the video will resume.
So, for practical purposes, play is good for setting up a visual indicator of the playback status, for example, the icon on the play / pause button. Use playing if you want to know when the video actually plays. For example, you might want to display a rotating loading icon when the waiting event fires, and then remove that icon when playing triggered.
(Besides the fact that you donβt have enough data, there are other reasons why the video will not play, even if you want it, but it may not cause the waiting and playing events to fire. This is in the HTML standard .)
source share