plotly / plotly/dash-player

Provide `is_playing` property

Open
#72 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
81
Forks
17
Avg merge
7d 1h
Merged PRs (30d)
2

Description

Currently there is no obvious way to determine within a callback, if the video is currently playing or not.

The existing playing property is not synchronized with the actual playback of the video as can be seen on the example page https://dash.plotly.com/dash-player
Specificall, the video can be started and stopped when clicking the checkbox but when starting the video playback with the video, the property is not changed.

This is not due to the specific example as a modficiation with printing the current state of the playing variable e.g.

@app.callback(
    Output("current-time-div", "children"),
    Input("player", "currentTime"),
    State("player", "playing"),
)
def display_currentTime(currentTime, playing):
    print(playing)
    return f"Current Time: {currentTime}"

shows: The value of playing can be False while the video is in fact playing by clicking on the play button within the video.

It would be great to either have the playing property synchronized with the actual video playback or provide a new isPlaying property that reflects the actual video playing state.
The same is true for the muted property (and possibly others).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Dash Player example page and the callback using the player’s currentTime and playing properties. Trace how playback state is exposed to callbacks, then verify that the chosen state representation reflects play-button changes and determine whether muted needs the same treatment.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python, react
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.