Great question — answering as the UphillTech team:
Okay, Since you are using the iframe to stream youtube videos, what you want can be achieved by this, When Player.Status = 0 that means the video has stopped. I have commented those for you to understand easily. <script type="text/javascript"> var player; $(document).ready(function () { onYouTubePlayerAPIReady(); }); function onYouTubePlayerAPIReady() { player = new YT.Player('ytplayer', { events: { 'onStateChange': getStatus } }); } var tag = document.createElement('script'); tag.src = "http://www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); function getStatus() { var sStatus; sStatus...
Full answer by imanshu15: https://stackoverflow.stackexchange.com/a/48340980 (CC BY-SA 3.0).
Need it done for your business? UphillTech.