'Check if video is aligned properly.
Arguments:
is_transcript_visible (bool): Transcript is visible or not.
Returns:
bool: Alignment result.'

def is_aligned(self, is_transcript_visible):

    wrapper_width = (75 if is_transcript_visible else 100)
    initial = self.browser.get_window_size()
    self.browser.set_window_size(300, 600)
    time.sleep(0.2)
    (real, expected) = self._dimensions
    width = (round(((100 * real['width']) / expected['width'])) == wrapper_width)
    self.browser.set_window_size(600, 300)
    time.sleep(0.2)
    (real, expected) = self._dimensions
    height = (abs((expected['height'] - real['height'])) <= 5)
    self.browser.set_window_size(initial['width'], initial['height'])
    return all([width, height])
