-
Notifications
You must be signed in to change notification settings - Fork 948
BUG(?): Player doesn't play if displaying twice #3967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Putting your code here so others can reproduce more quickly - I can confirm the behavior you are seeing. from ipywidgets import IntSlider, Play
from traitlets import link
player = Play()
slider = IntSlider(max=10, min=0, step=1)
link((player, 'value'), (slider, 'value'))
slider the behavior also occurs when using observe (not sure if that does the exact same thing as the link you used) from ipywidgets import IntSlider, Play, HBox
from traitlets import link
player = Play(interval=500)
slider = IntSlider(max=100, min=0, step=1)
# link((player, 'value'), (slider, 'value'))
def on_value_change(change):
slider.value = change['new']
# print(change['new'])
player.observe(on_value_change, names='value')
# uncomment the below line to see the working model
# HBox([slider, player])
# uncomment the below line to see that when you hit play it only increments once for each time play is clicked
# HBox([slider, player, player]) |
I encountered same issue. Also, if you delete a display of |
I have created another version of Here is Python and ESM source code for this widget. from ipywidgets import interact
from ipyslides.utils import AnimationSlider
widget = AnimationSlider(interval=20, nframes=20, continuous_update=False)
@interact(w=widget)
def animate(w):
print('w^2 = ', w**2)
widget 20250324-1530-36.2471137.mp4 |
Hi there,
Please try above. If display once, the player will play and the slider value keeps changing. If displaying twice and clicking the play button, the slider value only changes once.
The text was updated successfully, but these errors were encountered: