Say the video is a long playing one, the controls are kinda visually distracting (if not needed) so whats the best way to hide the controls when not needed and then return them on mouse activity?
Video interface :Hide Controls on mouse inactivity?
-
-
There's no event for this, so you have to build an action that checks mouse.x and mouse.y and if it changes over time.
Pretty simple really. -
Yep it's the only way. Elsewhere it's only on these kind of events : onmousedown/onmouseup/onkeydown/onkeyup.
For delay change the idletime value (default is 0.5) and use onidle event to hide interface.
Use a mouse move detection action as said above to restore the interface. -
I have had success with this JS, But it stops working after a few browser refreshes?
Code
Alles anzeigen<script> $(document).ready(function(){ var timer; var showHotspots = true; $('#pano').mouseover(function(e) { if (timer) { window.clearTimeout(timer); timer = 0; } if(showHotspots) { var krpano = document.getElementById("krpanoSWFObject"); krpano.call("videointerface_show_interface());"); krpano.call("set_hotspots_alpha(1.0);"); showHotspots = false; } timer = setTimeout(function() { var krpano = document.getElementById("krpanoSWFObject"); showHotspots = true; }, 3000); }); }); </script> <script> $(document).ready(function(){ var timer; var showHotspots = true; $('#pano').mousemove(function(e) { if (timer) { window.clearTimeout(timer); timer = 0; } if(showHotspots) { var krpano = document.getElementById("krpanoSWFObject"); krpano.call("videointerface_show_interface());"); krpano.call("set_hotspots_alpha(1.0);"); showHotspots = false; } timer = setTimeout(function() { var krpano = document.getElementById("krpanoSWFObject"); krpano.call("videointerface_hide_interface());"); krpano.call("set_hotspots_alpha(0.0);"); showHotspots = true; }, 3000); }); }); </script>
-
Thanks, Ill try onidle event to hide interface....
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!