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

Sunday, April 29th 2018, 11:57am

cannot send pause action via javascript [SOLVED]

Hi everyone,

I'm trying to send a pause signal to a flat video scene via javascript but it doesn't seem to work.

my code (in the index.html file) :

Source code

1
2
3
4
5
6
function jstest()
		{ 
		setTimeout(function(){ 
                      krpano.call("plugin[video].pause()");
                 }, 4000);
		}


i used the onready callback to create the krpano var.

and by modifying if, it doesn't work neither :

Source code

1
2
3
4
5
6
// my onready callback function
function krp(krpano_interface)
	{
		krpano = krpano_interface;  
		setTimeout(function(){  krpano.call("plugin[video].pause()"); }, 2000);
	}


Can I have some help ?
I wish you a wonderful and happy sunday !

Regards,
vYk

This post has been edited 3 times, last edit by "vyk" (Apr 29th 2018, 4:11pm)


Tuur

Sage

Posts: 3,154

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Sunday, April 29th 2018, 1:12pm

Hi,

like this?

http://www.virtualtuur.com/krpano/videotime_js/2/

click on the screen to trigger the 'onclick event call'. ... which calls javascript function: vidtime (see in index.html source.


Hope it helps
Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

3

Sunday, April 29th 2018, 1:27pm

Hi,

like this?

http://www.virtualtuur.com/krpano/videotime_js/2/

click on the screen to trigger the 'onclick event call'. ... which calls javascript function: vidtime (see in index.html source.


Hope it helps
Tuur *thumbsup*

Hi Tuur !
thank you so much for answering so fast !

maybe it works in your case because the pause funtion is triggered by an onclick event...

but when you try to send the signal from a setTimeout, it doesn't work

Adventure still go on !

Thanks a bunch Tuur *thumbup* *thumbsup* !

Tuur

Sage

Posts: 3,154

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Sunday, April 29th 2018, 1:50pm

Hi,

ok, i think it needs a click to trigger. So timeout could be problematic... let's see..

an option could be: try to use some code from here.. when video time > 4 ...

https://krpano.com/forum/wbb/index.php?p…75421#post75421

edit: i changed the code now.. on video ready calls javascript set timeout..

no click needed and seems to work.
when video starts it should pause after 2 secs.
http://www.virtualtuur.com/krpano/videotime_js/2/

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

5

Sunday, April 29th 2018, 2:12pm

I think it can be a very good starting point as I was totaly lost !

Initialy, I just wanted to do everything in JS but if there is a way to encrypt my xml files, I will also choose that solution

Tuur

Sage

Posts: 3,154

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

7

Sunday, April 29th 2018, 2:18pm

Oh yeah, it's wonderful ! where can i download it ? i cannot see any link
It's in the last version of krpano ZIP i guess
You're so great Tuur !!! *thumbsup* *thumbsup* *thumbsup*

Tuur

Sage

Posts: 3,154

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

8

Sunday, April 29th 2018, 2:29pm

it's in the krpano download folder, called: krpano tools app (or so)
start it. There is a encryption menu.
Go there , make your settings (bottom) and just drag your xml and encrypt.
Make sure you don't lose your originals!!
I mostly copy my code folder to keep the code open source as a back up.

Hope it helps!
Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

9

Sunday, April 29th 2018, 2:53pm

Ok I understand

I use panotour (using krpano) and.... it doesn't use the video plugin ..... but another that it's called ptvideosceneplayer !!!

and now I got everything I want...

Source code

1
2
3
4
function VideoPause(){	
     krpano = document.getElementById('krpanoSWFObject');	
     setTimeout(function(){ krpano.call("plugin[ptvideosceneplayer].pause();"); }, 2000);
}


Hope this helps others

Regards
vYk

This post has been edited 4 times, last edit by "vyk" (Apr 29th 2018, 4:10pm)


10

Monday, April 30th 2018, 2:11pm

it's in the krpano download folder, called: krpano tools app (or so)
start it. There is a encryption menu.
Go there , make your settings (bottom) and just drag your xml and encrypt.
Make sure you don't lose your originals!!
I mostly copy my code folder to keep the code open source as a back up.

Hope it helps!
Tuur *thumbsup*

Many many many thanks Tuur !!!