    def __init__(self, filename, height=None, width=None, max_delay=None):
        """
        :param filename: the file containingi the ANSI art.
        :param height: required height of the renderer.
        :param width: required width of the renderer.
        :param max_delay: maximum time interval (in secs) to wait between frame updates.
        """
        # Open the file and check it looks plausibly like a supported format.
        # pylint: disable-next=consider-using-with
        self._file = open(filename, "rb")
        header = json.loads(self._file.readline())
        if header["version"] != 2:
            raise RuntimeError("Unsupported file format")

        # Use file details if not overridden by constructor params.
        height = height if height else header["height"]
        width = width if width else header["width"]

        # Construct the full player now we have all the details.
        super().__init__(height, width)
        self._max_delay = max_delay
:param filename: the file containingi the ANSI art.
:param height: required height of the renderer.
:param width: required width of the renderer.
:param max_delay: maximum time interval (in secs) to wait between frame updates.
asciimatics/renderers/players.py