code: def play_media(self, url, content_type, title=None, thumb=None,
                     current_time=0, autoplay=True,
                     stream_type=STREAM_TYPE_BUFFERED,
                     metadata=None, subtitles=None, subtitles_lang='en-US',
                     subtitles_mime='text/vtt', subtitle_id=1):
          
          # pylint: disable=too-many-locals
          def app_launched_callback():
              """Plays media after chromecast has switched to requested app."""
              self._send_start_play_media(
                  url, content_type, title, thumb, current_time, autoplay,
                  stream_type, metadata, subtitles, subtitles_lang,
                  subtitles_mime, subtitle_id)
  
          receiver_ctrl = self._socket_client.receiver_controller
          receiver_ctrl.launch_app(self.app_id,
                                   callback_function=app_launched_callback)
docs: Plays media on the Chromecast. Start default media receiver if not
          already started.
  
          Parameters:
          url: str - url of the media.
          content_type: str - mime type. Example: 'video/mp4'.
          title: str - title of the media.
          thumb: str - thumbnail image url.
          current_time: float - seconds from the beginning of the media
              to start playback.
          autoplay: bool - whether the media will automatically play.
          stream_type: str - describes the type of media artifact as one of the
              following: "NONE", "BUFFERED", "LIVE".
          subtitles: str - url of subtitle file to be shown on chromecast.
          subtitles_lang: str - language for subtitles.
          subtitles_mime: str - mimetype of subtitles.
          subtitle_id: int - id of subtitle to be loaded.
          metadata: dict - media metadata object, one of the following:
              GenericMediaMetadata, MovieMediaMetadata, TvShowMediaMetadata,
              MusicTrackMediaMetadata, PhotoMediaMetadata.
  
          Docs:
          https://developers.google.com/cast/docs/reference/messages#MediaData