Use "seek()" or "starttime()" with a variable, possible or not ?

  • Hello,

    Sorry if I shoudn't post a specific topic as I asked this specific question in another one, so don't hesitate to delete it if it's a bad idea. As a user I think it's better when a topic has a clear title when googling for answers, it's also easier to find the right info in the topic.

    I hope I misunderstood the "seek" doc but when I try to set a variable in seek it seems it's not possible, am I right or wrong ? If I "seek(1.9999)" the video will start at 1,9999 seconds, but if I set a known variable instead it doesn't work. Source doc for seek : https://krpano.com/plugins/videoplayer/#seek

    Quote
    Code
    Parameters:
         time
            The intended playback position.
            Either in seconds.
            Or as percent value (0% - 100%).

    I see there's a "start position" too, but I don't even manage to make it work only with "1.0" or "1" as parameter so no need to try a variable ^^ starttime="1.0" in the plugin name="video" doesn't do anything, but perhaps it's not a number in seconds I shall put, I didn't find the info.

    If it's not possible to throw a var in seek() or starttime() am I totally stuck ? Does somebody have an idea on how I could load a video at the good point with a variable giving the time in seconds ? I have a var with the value in seconds I want the video to start at this value, but how could I tell it to the player if I can't with seek or starttime ? If not possible in krpano code directly could it be possible with javascript ?

    Thanks for reading,and finger crossed that there's a way to manage to do it.

    Best regards.

  • For future readers, I finally managed to do it, I'm not sure that was the smarter way but I'm really happy it was finally possible. I created a new action with calc "seek(" + variable + ")" then when calling the action I have the seek set at the good value. Lots of reading and thinking before I had this idea yesterday in my bed.

    Thanks a lot klaus.krpano and indexofrefraction without your help I wouldn't have manage anything and wouldn't have learned so much. The journey is still quite long and I'm not sure it will work, but I think the hardest is behind now. I hope I won't face new problems I didn't think about... time will tell.

    Have a nice week-end everybody :)

Participate now!

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