MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

src/video-iframe-integration.js:70–105  ·  view source on GitHub ↗

@param {!Window} win

(win)

Source from the content-addressed store, hash-verified

68export class AmpVideoIntegration {
69 /** @param {!Window} win */
70 constructor(win) {
71 /**
72 * Used for checking callback return type.
73 * @visibleForTesting
74 */
75 this.isAmpVideoIntegration_ = true;
76
77 /** @private @const */
78 this.callCounter_ = 0;
79
80 /** @private @const {!{[key: number]: function()}} */
81 this.callbacks_ = {};
82
83 /** @private @const {!Window} */
84 this.win_ = win;
85
86 /** @private @const {!{[key: string]: function()}} */
87 this.methods_ = {};
88
89 /** @private @const {function()} */
90 this.listenToOnce_ = once(() => {
91 listenTo(this.win_, (e) => this.onMessage_(e));
92 });
93
94 /** @private {boolean} */
95 this.muted_ = false;
96
97 /** @private {boolean} */
98 this.usedListenToHelper_ = false;
99
100 /**
101 * @return {!JsonObject}
102 * @private
103 */
104 this.getMetadataOnce_ = once(() => tryParseJson(this.win_.name));
105 }
106
107 /** @return {!JsonObject} */
108 getMetadata() {

Callers

nothing calls this directly

Calls 4

onMessage_Method · 0.95
onceFunction · 0.90
tryParseJsonFunction · 0.90
listenToFunction · 0.85

Tested by

no test coverage detected