MCPcopy
hub / github.com/ampproject/amphtml / onReadyState_

Method onReadyState_

src/preact/base-element.js:590–608  ·  view source on GitHub ↗

* @param {ReadyState_Enum} state * @param {*=} opt_failure * @private

(state, opt_failure)

Source from the content-addressed store, hash-verified

588 * @private
589 */
590 onReadyState_(state, opt_failure) {
591 this.setReadyState?.(state, opt_failure);
592
593 const Ctor = /** @type {typeof PreactBaseElement} */ (
594 /** @type {?} */ (this.constructor)
595 );
596 if (Ctor.unloadOnPause) {
597 // These are typically iframe-based elements where we don't know
598 // whether a media is currently playing. So we have to assume that
599 // it is whenever the element is loaded.
600 this.updateIsPlaying_(state == ReadyState_Enum.COMPLETE);
601 }
602
603 // Reset "loading" property back to "auto".
604 if (this.resetLoading_) {
605 this.resetLoading_ = false;
606 this.mutateProps({'loading': Loading_Enum.AUTO});
607 }
608 }
609
610 /** @private */
611 rerender_() {

Callers 2

getDefaultPropsMethod · 0.95

Calls 3

mutatePropsMethod · 0.95
setReadyStateMethod · 0.80
updateIsPlaying_Method · 0.80

Tested by

no test coverage detected