Sie sind nicht angemeldet.

1

Sonntag, 29. April 2018, 11:57

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) :

Quellcode

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 :

Quellcode

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

Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »vyk« (29. April 2018, 16:11)


Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

2

Sonntag, 29. April 2018, 13:12

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*

3

Sonntag, 29. April 2018, 13:27

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

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

4

Sonntag, 29. April 2018, 13:50

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*

5

Sonntag, 29. April 2018, 14:12

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

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

7

Sonntag, 29. April 2018, 14:18

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

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

8

Sonntag, 29. April 2018, 14:29

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*

9

Sonntag, 29. April 2018, 14:53

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...

Quellcode

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


Hope this helps others

Regards
vYk

Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »vyk« (29. April 2018, 16:10)


10

Montag, 30. April 2018, 14:11

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 !!!