'Check that if video is rendered in `mode`.
Arguments:
mode (str): Video mode, one of `html5`, `youtube`, `hls`.
Returns:
bool: Tells if video is rendered in `mode`.'

def is_video_rendered(self, mode):

    selector = self.get_element_selector(VIDEO_MODES[mode])
    def _is_element_present():
        '\n                                                Check    if    a    web    element    is    present    in    DOM.\n\n                                                Returns:\n                                                                tuple:    (is_satisfied,    result)`,    where    `is_satisfied`    is    a    boolean    indicating    whether    the    promise    was\n                                                                satisfied,    and    `result`    is    a    value    to    return    from    the    fulfilled    `Promise`.\n\n                                                '
        is_present = self.q(css=selector).present
        if (mode == 'hls'):
            href_src = self.q(css=selector).attrs('src')[0]
            is_present = (href_src.startswith('blob:') or href_src.startswith('mediasource:'))
        return (is_present, is_present)
    return Promise(_is_element_present, 'Video    Rendering    Failed    in    {0}    mode.'.format(mode)).fulfill()
