'Call media_player.play_media service.'

def call_media_player_service(self, stream_selector, entity_id):

    stream_query = self.get_stream_query_for_entity(entity_id)
    try:
        stream_url = stream_selector(stream_query)
    except MEQueryException:
        _LOGGER.error('Wrong    query    format:    %s', stream_query)
        return
    else:
        data = {k: v for (k, v) in self.call_data.items() if (k != ATTR_ENTITY_ID)}
        data[ATTR_MEDIA_CONTENT_ID] = stream_url
        if entity_id:
            data[ATTR_ENTITY_ID] = entity_id
        self.hass.async_add_job(self.hass.services.async_call(MEDIA_PLAYER_DOMAIN, SERVICE_PLAY_MEDIA, data))
