I noticed that my browser throws a lot of error messages, whenever I restart the server in python while the page is still loaded in the browser. This even happens for the supplied examples. The video player works nicely, but I donβt know if this somehow impacts performance, so I want to get rid of these error messages.
Reproduction is quite simple:
- Start dash app in python
- Open dash app in browser
- Restart dash app in python
- Open browser console (F12)
Example Code from dash-player/DashPlayer.py at master Β· plotly/dash-player Β· GitHub :
import dash_player
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
app = dash.Dash(__name__)
app.scripts.config.serve_locally = True
app.layout = html.Div(
[
dash_player.DashPlayer(
id="video-player",
url="http://media.w3.org/2010/05/bunny/movie.mp4",
controls=True,
),
dcc.Checklist(
id="radio-bool-props",
options=[
{"label": val.capitalize(), "value": val}
for val in ["playing", "loop", "controls", "muted", "seekTo"]
],
value=["controls"],
),
]
)
@app.callback(Output("video-player", "playing"), [Input("radio-bool-props", "value")])
def update_prop_playing(value):
return "playing" in value
@app.callback(Output("video-player", "loop"), [Input("radio-bool-props", "value")])
def update_prop_loop(value):
return "loop" in value
@app.callback(Output("video-player", "controls"), [Input("radio-bool-props", "value")])
def update_prop_controls(value):
return "controls" in value
@app.callback(Output("video-player", "muted"), [Input("radio-bool-props", "value")])
def update_prop_muted(value):
return "muted" in value
@app.callback(Output("video-player", "seekTo"), [Input("radio-bool-props", "value")])
def update_prop_seekTo(value):
if "seekTo" in value:
return 5
if __name__ == "__main__":
app.run_server(debug=True)
Maybe it has to do with any recent updates, as the DashPlayer component is from 2019. Any ideas, @xhlu or someone else?
Thanks a lot!