Sie sind nicht angemeldet.

1

Mittwoch, 18. Juni 2014, 18:51

start a pano at a certain time using seek()

Hi,
I am just new to this. I was doing a proof of concept to load a 3D video in Krpano viewer and play at a certain starting time (in seconds). i thought using plugin seek function would be perfect one. But i am struggling with this. I would highly appreciated if some one can help me. Here is the code i am using

embedpano({ swf: "../../viewer/krpano.swf", xml:"video.xml", target: "krpanoSWFObject", html5: "auto", passQueryParameters: false, onready: krpanoReady });

function krpanoReady(krpano) {
var plugin = krpano.get(document.getElementById('krpanoSWFObject'));
plugin.seek(30);
plugin.play();
}
Thanks in advance!

Heming

2

Freitag, 20. Juni 2014, 19:19

Hi,

your code is wrong, if you want to do all from Javascript, try it this way:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
function krpanoReady(krpano)
{
  if ( krpano.get("plugin[video].isvideoready") )
  {
    krpano.call("plugin[video].seek(30); plugin[video].play();");
  }
  else
  {
    krpano.set("plugin[video].onvideoready", "seek(30);play();");
  }
}


(btw - instead of 'video' in 'plugin[video]' you would need to use the name of the videoplayer plugin in your example)

Best regards,
Klaus

3

Samstag, 21. Juni 2014, 00:26

Follow up question

Klaus, Thanks for you help

I have tried the code your recommended before with no luck. I am really confused by the video in plug[video] statement. Should it be id parameter in embedpano() or something else.

Auctually I was just using index.html in your videointerface example to test your code. here is the part of the code I changed. And it is still not working.
embedpano({ swf: "../../viewer/krpano.swf", xml: "video.xml", target: "pano", html5: "auto", passQueryParameters: true, onready: krpanoReady });
function krpanoReady(krpano) {if (krpano.get("plugin[video].isvideoready")) {krpano.call("plugin[video].seek(30); plugin[video].play();");
}
else {krpano.set("plugin[video].onvideoready", "seek(30);play();");
}
}


It is urgent needed help. I really appreciated it if you could help me.

you have a great weekend. Heming

4

Samstag, 21. Juni 2014, 05:03

followup

Hi, Klauso

Ok I looked into videointerface.xml, and I kinda figured out. here is the code I adjusted:
if (krpano.get("plugin[get(videointerface_video)].isvideoready")) {krpano.call("plugin[get(videointerface_video)].seek(30); plugin[get(videointerface_video)].play();");
}
else {krpano.set("plugin[get(videointerface_video)].onvideoready", "seek(30);play();");
}
I did runtime debugging, it did passed the statement:
if (krpano.get("plugin[get(videointerface_video)].isvideoready")). However the following statement didn't do anything. krpano.call("plugin[get(videointerface_video)].seek(30); plugin[get(videointerface_video)].play();");
instead it gaves undefined error. Could you help me figure out what is wrong with my statement.
Thanks in advance!
Heming

5

Samstag, 21. Juni 2014, 09:48

Hi,

when using the videointerface example the best way would be simply editing the xml,

e.g. open the video.xml and look for this line:

Quellcode

1
onvideoready="videointerface_setvideo(get(name));"


and change it to:

Quellcode

1
onvideoready="seek(30); videointerface_setvideo(get(name));"


Best regards,
Klaus

Ähnliche Themen