Setting playtime via redux in Podlove Web Player

I’m sorry for my newbie question - I’m not familar with redux. I would like to set the playtime of the player after initialization with something like this:

window
  .podlovePlayer("#app", "fixtures/episode.json", "fixtures/config.json")
  .then(store => {
    store.dispatch({
      type: "PLAYER_UPDATE_PLAYTIME",
      payload: 60000
    });
  });

But it doesn’t work. What am I doing wrong here?

Not a newbie question at all :smiley: You are on the right track, to request a playtime update you should use PLAYER_REQUEST_PLAYTIME :nerd_face:

Ok - I tried it, but there is no difference? Is “payload” correct? Milliseconds?

Yes payload in milliseconds. Could you give me a reference so I can debug what’s happening behind the scenes?

Here is a simple example: https://verunsicherung.de/upload/podloveplayer-test.zip

Just unzip file and use it on a webserver (e.g. run “python -m SimpleHTTPServer” in directory and open http://localhost:8000/ in browser.

Ah ok, yes it is a bit more complicated:

      window
        .podlovePlayer("#podcastplayer", "podlove_folge64.json", "podlove_config.json")
        .then((store) => {
          store.subscribe(() => {
            const { lastAction } = store.getState();

            if (lastAction.type === 'PLAYER_READY') {
              store.dispatch({
                type: "PLAYER_REQUEST_PLAYTIME",
                payload: 60000
              });
            }
          })
        });

I would suggest to also disable the “persistPlaystate” feature since it will interfere with your efforts. You should add this to the config:

  "features": {
    "persistPlaystate": false
  }

Finally there is already an option to add the playtime to the url in the ISO-8601 format like this: ?t=01:00

Yeah, thank you - it works!

Yes, but I’m using the player inside a vuejs component and set the playtime as result of some other actions of the user.

You might also want to have a look at the native integration. This is a very small example: https://codesandbox.io/s/player-example-73egi