I prepared this code to play mp3 file from callback
It play on PC or iOS Firefox ,however not play on iOS Safari.
It looks like iOS Safari has limitation to play audio.
However I can not find out how to apply it to dash app.
Could you please advise me how to overcome?
And also ,
I hope I can play sound file from callback without reloading component.
from dash import dcc,html,Dash import dash from dash.dependencies import Input, Output, State sound=html.Audio(src="assets/soundfile.mp3",id="effect",autoPlay=True,controls=False,loop=False) app = dash.Dash(__name__,title="app1") app.layout= html.Div( [html.Button("play",id="play",n_clicks=0), html.Div(id="player")]) @app.callback( Output("player","children"), Input("play","n_clicks"), ) def func1(n): if n%2==1: return(sound) else: return("") if __name__ == '__main__': app.run_server(debug=True, host='0.0.0.0', port=8051,use_reloader=False)