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

  • Hi,

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

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

    Best regards,
    Klaus

  • 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

  • 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([size=10][font='Consolas']"plugin[get(videointerface_video)].seek(30); plugin[get(videointerface_video)].play();"[size=10][font='Consolas'][size=10][font='Consolas']);[size=10][font='Consolas'][size=10][font='Consolas']
    }
    [size=10][font='Consolas'][size=10][font='Consolas'][size=10][font='Consolas']else[size=10][font='Consolas'][size=10][font='Consolas'] {krpano.set([size=10][font='Consolas'][color=#a31515][size=10][font='Consolas'][color=#a31515][size=10][font='Consolas']"plugin[get(videointerface_video)].onvideoready"[size=10][font='Consolas'][size=10][font='Consolas'], [color=#a31515][size=10][font='Consolas'][color=#a31515][size=10][font='Consolas'][color=#a31515][size=10][font='Consolas']"seek(30);play();"[size=10][font='Consolas'][size=10][font='Consolas']);[size=10][font='Consolas'][size=10][font='Consolas']
    }
    I did runtime debugging, it did passed the statement:
    [color=#0000ff]if[size=10][font='Consolas'][size=10][font='Consolas'] (krpano.get([color=#a31515][size=10][font='Consolas'][color=#a31515][size=10][font='Consolas'][color=#a31515][size=10][font='Consolas']"plugin[get(videointerface_video)].isvideoready"[size=10][font='Consolas'][size=10][font='Consolas'])). However the following statement didn't do anything. krpano.call([color=#a31515][size=10][font='Consolas'][color=#a31515][size=10][font='Consolas'][color=#a31515][size=10][font='Consolas']"plugin[get(videointerface_video)].seek(30); plugin[get(videointerface_video)].play();"
    [color=#a31515]
    [color=#a31515]
    [color=#a31515]
    [color=#a31515][size=10][font='Consolas'][size=10][font='Consolas']);

    instead it gaves undefined error. Could you help me figure out what is wrong with my statement.
    Thanks in advance!
    Heming

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

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

    and change it to:

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

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!