nicolaskruchten: Ah this is a really nice one, thanks :)
diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py
index 4317febde..01c08acf1 100644
--- a/plotly/offline/offline.py
+++ b/plotly/offline/offline.py
@@ -311,7 +311,7 @@ def init_notebook_mode(connected=False):
 
 
 def _plot_html(figure_or_data, config, validate, default_width,
-               default_height, global_requirejs):
+               default_height, global_requirejs, auto_play):
 
     figure = tools.return_figure_from_figure_or_data(figure_or_data, validate)
 
@@ -348,13 +348,20 @@ def _plot_html(figure_or_data, config, validate, default_width,
                                                          'https://plot.ly')
 
     if jframes:
+        if auto_play:
+            animate = (".then(function(){" +
+                       "Plotly.animate('{id}');".format(id=plotdivid) +
+                       "})")
+        else:
+            animate = ''
+
         script = '''
         Plotly.plot(
             '{id}',
             {data},
             {layout},
             {config}
-        ).then(function () {add_frames}).then(function(){animate})
+        ).then(function () {add_frames}){animate}
         '''.format(
             id=plotdivid,
             data=jdata,
@@ -363,7 +370,7 @@ def _plot_html(figure_or_data, config, validate, default_width,
             add_frames="{" + "return Plotly.addFrames('{id}',{frames}".format(
                 id=plotdivid, frames=jframes
             ) + ");}",
-            animate="{" + "Plotly.animate('{id}');".format(id=plotdivid) + "}"
+            animate=animate
         )
     else:
         script = 'Plotly.newPlot("{id}", {data}, {layout}, {config})'.format(
@@ -397,7 +404,7 @@ def _plot_html(figure_or_data, config, validate, default_width,
 
 def iplot(figure_or_data, show_link=False, link_text='Export to plot.ly',
           validate=True, image=None, filename='plot_image', image_width=800,
-          image_height=600, config=None):
+          image_height=600, config=None, auto_play=True):
     """
     Draw plotly graphs inside an IPython or Jupyter notebook without
     connecting to an external server.
@@ -433,6 +440,9 @@ def iplot(figure_or_data, show_link=False, link_text='Export to plot.ly',
     config (default=None) -- Plot view options dictionary. Keyword arguments
         `show_link` and `link_text` set the associated options in this
         dictionary if it doesn't contain them already.
+    auto_play (default=True) -- Whether to automatically start the animation
+        sequence if the figure contains frames. Has no effect if the figure
+        does not contain frames.
 
     Example:
     ```
@@ -473,8 +483,7 @@ def iplot(figure_or_data, show_link=False, link_text='Export to plot.ly',
 
     if __PLOTLY_OFFLINE_INITIALIZED:
         plot_html, plotdivid, width, height = _plot_html(
-            figure_or_data, config, validate, '100%', 525, True
-        )
+            figure_or_data, config, validate, '100%', 525, True, auto_play)
         resize_script = ''
         if width == '100%' or height == '100%':
             resize_script = _build_resize_script(
@@ -515,7 +524,7 @@ def plot(figure_or_data, show_link=False, link_text='Export to plot.ly',
          validate=True, output_type='file', include_plotlyjs=True,
          filename='temp-plot.html', auto_open=True, image=None,
          image_filename='plot_image', image_width=800, image_height=600,
-         config=None, include_mathjax=False):
+         config=None, include_mathjax=False, auto_play=True):
     """ Create a plotly graph locally as an HTML document or string.
 
     Example:
@@ -625,6 +634,9 @@ def plot(figure_or_data, show_link=False, link_text='Export to plot.ly',
         If a string that ends in '.js', a script tag is included that
         references the specified path. This approach can be used to point the
         resulting HTML file to an alternative CDN.
+    auto_play (default=True) -- Whether to automatically start the animation
+        sequence on page load if the figure contains frames. Has no effect if
+        the figure does not contain frames.
     """
     if output_type not in ['div', 'file']:
         raise ValueError(
@@ -642,7 +654,7 @@ def plot(figure_or_data, show_link=False, link_text='Export to plot.ly',
 
     plot_html, plotdivid, width, height = _plot_html(
         figure_or_data, config, validate,
-        '100%', '100%', global_requirejs=False)
+        '100%', '100%', global_requirejs=False, auto_play=auto_play)
 
     # Build resize_script
     resize_script = ''

Allow users to control autoplay feature on Python animation frames
Hey all,

Loving the new animation functionality you've introduced!

It would be great if you could allow us to decide whether or not we want the animation to autoplay. 

For example, your GapMinder plot created with the Python API [here](https://plot.ly/python/animations/) autoplays, whilst the same plot with .js [here](https://plot.ly/javascript/animations/) doesn't.

Cheers!
diff --git a/plotly/tests/test_core/test_offline/test_offline.py b/plotly/tests/test_core/test_offline/test_offline.py
index 6607b38dc..8fb349918 100644
--- a/plotly/tests/test_core/test_offline/test_offline.py
+++ b/plotly/tests/test_core/test_offline/test_offline.py
@@ -23,6 +23,18 @@ fig = {
     )
 }
 
+fig_frames = {
+    'data': [
+        plotly.graph_objs.Scatter(x=[1, 2, 3], y=[10, 20, 30])
+    ],
+    'layout': plotly.graph_objs.Layout(
+        title='offline plot'
+    ),
+    'frames': [
+        {'layout': {'title': 'frame 1'}}
+    ]
+}
+
 
 resize_code_strings = [
             'window.addEventListener("resize", ',
@@ -52,6 +64,9 @@ mathjax_cdn_script = ('<script src="{cdn}{config}"></script>'
 
 mathjax_font = 'STIX-Web'
 
+add_frames = 'Plotly.addFrames'
+
+do_auto_play = 'Plotly.animate'
 
 class PlotlyOfflineBaseTestCase(TestCase):
     def tearDown(self):
@@ -396,3 +411,13 @@ class PlotlyOfflineTestCase(PlotlyOfflineBaseTestCase):
         self.assertNotIn(mathjax_cdn_script, html)
         self.assertIn(other_cdn+mathjax_config_str, html)
         self.assertIn(mathjax_font, html)
+
+    def test_auto_play(self):
+        html = plotly.offline.plot(fig_frames, output_type='div')
+        self.assertIn(add_frames, html)
+        self.assertIn(do_auto_play, html)
+
+    def test_no_auto_play(self):
+        html = plotly.offline.plot(fig_frames, output_type='div', auto_play=False)
+        self.assertIn(add_frames, html)
+        self.assertNotIn(do_auto_play, html)

pip install -e .[dev]
parse_log_pytest
requirements.txt
numpy>=1.16.0 pandas>=1.0.0 nose pytest
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==25.3.0
certifi==2025.1.31
charset-normalizer==3.4.1
decorator==5.2.1
exceptiongroup==1.2.2
fastjsonschema==2.21.1
idna==3.10
iniconfig==2.1.0
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter_core==5.7.2
nbformat==5.10.4
nose==1.3.7
numpy==2.0.2
packaging==24.2
pandas==2.2.3
platformdirs==4.3.7
-e git+https://github.com/plotly/plotly.py.git@b3dbcebc4950b935d71cdb91950622a63957b3e3#egg=plotly
pluggy==1.5.0
pytest==8.3.5
python-dateutil==2.9.0.post0
pytz==2025.2
referencing==0.36.2
requests==2.32.3
retrying==1.3.3
rpds-py==0.24.0
six==1.8.0
tomli==2.2.1
traitlets==5.14.3
typing_extensions==4.13.0
tzdata==2025.2
urllib3==2.3.0

name: plotly.py
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==25.3.0
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - decorator==5.2.1
      - exceptiongroup==1.2.2
      - fastjsonschema==2.21.1
      - idna==3.10
      - iniconfig==2.1.0
      - jsonschema==4.23.0
      - jsonschema-specifications==2024.10.1
      - jupyter-core==5.7.2
      - nbformat==5.10.4
      - nose==1.3.7
      - numpy==2.0.2
      - packaging==24.2
      - pandas==2.2.3
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - referencing==0.36.2
      - requests==2.32.3
      - retrying==1.3.3
      - rpds-py==0.24.0
      - six==1.8.0
      - tomli==2.2.1
      - traitlets==5.14.3
      - typing-extensions==4.13.0
      - tzdata==2025.2
      - urllib3==2.3.0
prefix: /opt/conda/envs/plotly.py

plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_no_auto_play
plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_auto_play plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_autoresizing plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_autoresizing_div plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_config plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_config_bad_options plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_default_plot_generates_expected_html plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_div_output plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_include_mathjax_cdn_div plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_include_mathjax_cdn_html plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_include_mathjax_false_div plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_include_mathjax_false_html plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_include_mathjax_path_div plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_include_mathjax_path_html plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_cdn_div plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_cdn_html plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_directory_div plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_directory_html plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_false_div plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_false_html plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_path_div plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_path_html plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_truthy_div plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_including_plotlyjs_truthy_html plotly/tests/test_core/test_offline/test_offline.py::PlotlyOfflineTestCase::test_plotlyjs_version
plotly/offline/offline.py
plotly/offline/offline.py