You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, April 8th 2015, 2:28am

Video interface :Hide Controls on mouse inactivity?

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?

Posts: 1,850

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

2

Thursday, April 9th 2015, 7:10am

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.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

benji33

Intermediate

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

3

Thursday, April 9th 2015, 9:24am

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.

4

Thursday, April 9th 2015, 4:51pm

I have had success with this JS, But it stops working after a few browser refreshes?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  	<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>   
	
	
 
	

5

Thursday, April 9th 2015, 4:54pm

Thanks, Ill try onidle event to hide interface....

This post has been edited 1 times, last edit by "SpinStudios" (Apr 9th 2015, 5:08pm)