     else
       fullScreenButton.innerHTML = 'fullscreen'
       fullScreenButton.dataset.status = 'false'
+      setTimeout(resizeContainer, 10)
     return
 
   document.onmozfullscreenchange = ->

  # whether the interactive area is displayed or hidden
  resizeContainer = ->
    height = $(window).height()
    factor = if $('#caption').is(':hidden') then 1 else 1 / 0.82
    width = Math.floor((video.videoWidth * $(window).height() /
    video.videoHeight) * factor)
    if width > $(window).width()
      shrink = $(window).width() / width
      height = Math.floor(height * shrink)
      width = $(window).width()
    top = Math.floor(0.5*($(window).height() - height))

    else
      fullScreenButton.innerHTML = 'fullscreen'
      fullScreenButton.dataset.status = 'false'
      setTimeout(resizeContainer, 10)
    return

  # Event listeners for the seek bar
