src/redispatch.js
// letting it go on its way without any meddling.
letting it go on its way without any meddling.
letting it go on its way without any meddling .
function redispatch(event) {
  if (event.type === 'playing') {
    handlePlaying(this, event);
  } else if (event.type === 'ended') {
    handleEnded(this, event);
  } else if (event.type === 'loadstart' ||
             event.type === 'loadeddata' ||
             event.type === 'loadedmetadata') {
    handleLoadEvent(this, event);
  } else if (event.type === 'play') {
    handlePlay(this, event);
  } else if (this.ads.isInAdMode()) {
    if (this.ads.isContentResuming()) {
      prefixEvent(this, 'content', event);
    } else {
      prefixEvent(this, 'ad', event);
    }
  }
}
function redispatch ( event ) { if ( event . type === 'playing' ) { handlePlaying ( this , event ) ; } else if ( event . type === 'ended' ) { handleEnded ( this , event ) ; } else if ( event . type === 'loadstart' || event . type === 'loadeddata' || event . type === 'loadedmetadata' ) { handleLoadEvent ( this , event ) ; } else if ( event . type === 'play' ) { handlePlay ( this , event ) ; } else if ( this . ads . isInAdMode ( ) ) { if ( this . ads . isContentResuming ( ) ) { prefixEvent ( this , 'content' , event ) ; } else { prefixEvent ( this , 'ad' , event ) ; } } }
letting it go on its way without any meddling.
letting it go on its way without any meddling .
// Events with special treatment // Standard handling for all other events // Event came from snapshot restore after an ad, use "content" prefix // Event came from ad playback, use "ad" prefix