Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

Douglas Rhiner

Fortgeschrittener

  • »Douglas Rhiner« ist der Autor dieses Themas

Beiträge: 141

Wohnort: San Anselmo, CA

Beruf: Code-Slave

  • Nachricht senden

1

Mittwoch, 19. Oktober 2011, 19:36

Onvideoready, get() and set() totaltime global variable

I'm trying to accomplish the following:




Onclick play video.

When the video is 2 seconds from ending, load a new panorama.




The parts I'm having issue with is first; "getting" the totaltime of the video, and second; getting the time ( current play position ) of the video into variables that I can access at a global level.
If I get the first half resolved I'm sure the second will snap into place in my head.







When I set the video plugin ( named "trans" ) onvideoready event to: onvideoready="gettranstime();" ………




….. referencing the action ……




<action name="gettranstime">

showlog(true);

set(mytime,get(plugin[trans].totaltime));

trace('video time=',get(mytime));

</action>




…. total time is "got" and the value traces as expected.




What I'd like to be able to do here is set the video plugin ( named "trans" ) onvideoready event to: onvideoready="set(mytime,get(plugin[trans].totaltime));"

and be able to access the variable "mytime" like….




<action name="gettranstime">

showlog(true);

trace('video time=',get(mytime));

</action>




….but the "mytime" variable does not seem to resolve this way ( meaning the code "set(mytime,get(plugin[trans].totaltime));" is not within the <action> ) and the value NULL is traced.




So basically what I need to have happen is when a video is "ready" the total time is "got" and is stored in a globally accessible variable.




Do I not understand some core concepts here? *confused*

Is "my time" truly being set as a "Global" variable? *wacko*




TIA for any input.

Douglas Rhiner

Fortgeschrittener

  • »Douglas Rhiner« ist der Autor dieses Themas

Beiträge: 141

Wohnort: San Anselmo, CA

Beruf: Code-Slave

  • Nachricht senden

2

Montag, 5. Dezember 2011, 21:17

I'm bumping this because I'm back to tackling this issue and still am canvasing for advice on this one....

3

Dienstag, 1. März 2016, 11:38

I'm bumping this because I'm back to tackling this issue and still am canvasing for advice on this one....
I am having the same issue with totaltime. It would really be helpful to find an answer. I'm still keeping an eye out :)

4

Dienstag, 1. März 2016, 11:51

I'm bumping this because I'm back to tackling this issue and still am canvasing for advice on this one....
I am having the same issue with totaltime. It would really be helpful to find an answer. I'm still keeping an eye out :)
Found something! how to get information on video player. SEE BELOW

----
Hi,

Zitat


Quoted

1. how to get the video current time and total time? i don't want to use xml.

krpano.get("any variables for times")?
e.g. via:


Source code
1
2

krpano.get("plugin[NAME].time");
krpano.get("plugin[NAME].totaltime");

where NAME is the name of the plugin element inside the xml.


Zitat


Quoted

2. how to get the plugin class on JS ? i tried a lot of ways... but i couldn't any ways...
because i want to know event that video play,stop,buffer,play end, play start....
The HTML5 videoplayer plugin exposes the internal <video> DOM element via:


Source code
1

krpano.get("plugin[NAME]").videoDOM

but when changing the video state directly via that object, the krpano states might not match. Also note - when playing a new video that object might change too.

To avoid cross-browsers problems, I would recommend using the krpano videoplayer APIs.

Best regards,
Klaus

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

5

Dienstag, 1. März 2016, 12:16

Hi,

something like this should works

videoplugin

Quellcode

1
2
3
4
5
6
onloaded="MakeMyTime();"
onvideoready="delayedcall(1, 
				set(mytime, get(plugin[video].totaltime));
				roundval(mytime);
				sub(mytime, 2);
				);"


and the makemytime action

Quellcode

1
2
3
4
5
	asyncloop(true,
		set(_vdotime, get(plugin[video].time));
		roundval(_vdotime);
		if(_vdotime == mytime, trace('Cheers from Tuur'));
	);


Hope this helps
Tuur *thumbsup*