def display_in_notebook(
    clip,
    filetype=None,
    maxduration=60,
    t=None,
    fps=None,
    rd_kwargs=None,
    center=True,
    **html_kwargs,
):
    """Displays clip content in an Jupyter Notebook.

    Remarks: If your browser doesn't support HTML5, this should warn you.
    If nothing is displayed, maybe your file or filename is wrong.
    Important: The media will be physically embedded in the notebook.

    Parameters
    ----------

    clip : moviepy.Clip.Clip
      Either the name of a file, or a clip to preview. The clip will actually
      be written to a file and embedded as if a filename was provided.

    filetype : str, optional
      One of ``"video"``, ``"image"`` or ``"audio"``. If None is given, it is
      determined based on the extension of ``filename``, but this can bug.

    maxduration : float, optional
      An error will be raised if the clip's duration is more than the indicated
      value (in seconds), to avoid spoiling the browser's cache and the RAM.

    t : float, optional
      If not None, only the frame at time t will be displayed in the notebook,
      instead of a video of the clip.

    fps : int, optional
      Enables to specify an fps, as required for clips whose fps is unknown.

    rd_kwargs : dict, optional
      Keyword arguments for the rendering, like ``dict(fps=15, bitrate="50k")``.
      Allow you to give some options to the render process. You can, for
      example, disable the logger bar passing ``dict(logger=None)``.

    center : bool, optional
      If true (default), the content will be wrapped in a
      ``<div align=middle>`` HTML container, so the content will be displayed
      at the center.

    kwargs
      Allow you to give some options, like ``width=260``, etc. When editing
      looping gifs, a good choice is ``loop=1, autoplay=1``.

    Examples
    --------

    .. code:: python

        from moviepy import *
        # later ...
        clip.display_in_notebook(width=360)
        clip.audio.display_in_notebook()

        clip.write_gif("test.gif")
        display_in_notebook('test.gif')

        clip.save_frame("first_frame.jpeg")
        display_in_notebook("first_frame.jpeg")
    """
    if not ipython_available:
        raise ImportError("Only works inside an Jupyter Notebook")

    if rd_kwargs is None:
        rd_kwargs = {}

    if fps is not None:
        rd_kwargs["fps"] = fps

    if t is not None:
        clip = clip.to_ImageClip(t)

    return HTML2(
        html_embed(
            clip,
            filetype=filetype,
            maxduration=maxduration,
            center=center,
            rd_kwargs=rd_kwargs,
            **html_kwargs,
        )
    )
Displays clip content in an Jupyter Notebook.

    Remarks: If your browser doesn't support HTML5, this should warn you.
    If nothing is displayed, maybe your file or filename is wrong.
    Important: The media will be physically embedded in the notebook.

    Parameters
    ----------

    clip : moviepy.Clip.Clip
      Either the name of a file, or a clip to preview. The clip will actually
      be written to a file and embedded as if a filename was provided.

    filetype : str, optional
      One of ``"video"``, ``"image"`` or ``"audio"``. If None is given, it is
      determined based on the extension of ``filename``, but this can bug.

    maxduration : float, optional
      An error will be raised if the clip's duration is more than the indicated
      value (in seconds), to avoid spoiling the browser's cache and the RAM.

    t : float, optional
      If not None, only the frame at time t will be displayed in the notebook,
      instead of a video of the clip.

    fps : int, optional
      Enables to specify an fps, as required for clips whose fps is unknown.

    rd_kwargs : dict, optional
      Keyword arguments for the rendering, like ``dict(fps=15, bitrate="50k")``.
      Allow you to give some options to the render process. You can, for
      example, disable the logger bar passing ``dict(logger=None)``.

    center : bool, optional
      If true (default), the content will be wrapped in a
      ``<div align=middle>`` HTML container, so the content will be displayed
      at the center.

    kwargs
      Allow you to give some options, like ``width=260``, etc. When editing
      looping gifs, a good choice is ``loop=1, autoplay=1``.

    Examples
    --------

    .. code:: python

        from moviepy import *
        # later ...
        clip.display_in_notebook(width=360)
        clip.audio.display_in_notebook()

        clip.write_gif("test.gif")
        display_in_notebook('test.gif')

        clip.save_frame("first_frame.jpeg")
        display_in_notebook("first_frame.jpeg")
    
moviepy/video/io/display_in_notebook.py