How are the payload values needed for podlove player actions?

Hello community,

based on the examples under Runtime API | Podlove Documentation

and podlove-ui/types.js at development · podlove/podlove-ui · GitHub

I would like to know how is the usage of the payload attribute for the actions.

I am working with plain JS on a HTML Site. I can not install the npm package for the actions.

Some actions as PLAYER_REQUEST_PLAYTIME are working for me, the payload makes sense but for example to hide a progressbar I am trying this example beneath but I do not know the proper value for the payload (I also tryed without the property).

Also things like HIDE_VISIBLE_COMPONENTS_TAB_FILES are not working for me.

Here is one example.

Thanks!

Here is my example

<script> 
 podlovePlayer('#example', '/path/to/episode/definition/or/object', '/path/to/configuration/or/object')
          .then(store => {    
                 store.dispatch(
                        { type: 'HIDE_VISIBLE_COMPONENTS_CONTROLS_PROGRESSBAR', 
                           payload: ????
                         }
                    );  
                })
</script>

Hey Gongo,

the payload is optional depending on the action. It will be used by reducers and effects to create the player state and behaviour. See podlove-ui/packages/player/state at development · podlove/podlove-ui · GitHub for more information on what it is used. Also if you face any issues feel free to describe your intend and I will try to help you identify the needed actions.

1 Like

Hi Zusatzstoff,

thank you, I really liked your player so I will give my best to implement it for the clients.
Cool that you are active in the forum. Thanks again

1 Like

Hi @zusatzstoff,
i hope it’s ok that I simply extend this thread.

My goal is to add a “go to previous playlist entry” and “skip to next playlist entry” button to the player. On the UI side I already accomplished that but I am struggling with the code.

I know there is the NEXT_PLAYLIST_ENTRY but I don’t know what payload to use.

player.then(store => 
        {
        store.dispatch(
          {
            type: 'NEXT_PLAYLIST_ENTRY',
            payload: ???
          });
        });

For the “go to the previous playlist entry” part I am without clue how to accomplish that. Maybe this is optional since it is too much effort for me.

Even with the ReduxDevTools and reading through the Podlove documentation and files it is quite hard for me to understand the logic behind Redux actions. On the other hand I have to admit that I don’t have the time to spend hours to learn about them just for a “skip a song” feature.

I know your time is precious, but I would be very thankful for a hint how to skip an episode. Thank you in advance!

Hello @khtul,

I think I stumbled upon your solution I think and like to document it for future generations:

The Payload should be {play: true}.

I hope this helps someone in the future.

1 Like

Thank you <3

Meanwhile I developed my own player but I hope the solution helps others!