One of the problems with @EnigmaRM's answer is that if jQuery somehow skips the hover event, the controls may switch to the "wrong" way - that is, they disappear when you enter the mouse and reappear when you leave the mouse.
Instead, we can ensure that controls always appear and disappear correctly with event.type :
$("#myvideo").hover(function(event) { if(event.type === "mouseenter") { $(this).attr("controls", ""); } else if(event.type === "mouseleave") { $(this).removeAttr("controls"); } });
rickcnagy
source share