State of Player Widget

With the player widget, is there an attribute to know whether the player is currently “playing” or if it is “paused”/“stopped”?

I think not, but can be submitted as a Github feature request to create a “playing” variable here (if I’m not mistaken):

And then expose it here.

1 Like

If you can’t wait you can expose the direction parameter:

import panel as pn
import param

pn.extension()

class Player2(pn.widgets.Player):
    direction = param.Integer(readonly=True)

player = Player2(name='Player', start=0, end=100, value=32, loop_policy='loop')

pn.Column(player, player.param.direction)

player

3 Likes