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

Method method

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

* @param {string} name * @param {function()} callback

(name, callback)

Source from the content-addressed store, hash-verified

114 * @param {function()} callback
115 */
116 method(name, callback) {
117 userAssert(validMethods.indexOf(name) > -1, `Invalid method ${name}.`);
118
119 const wrappedCallback =
120 name == 'play' || name == 'pause'
121 ? this.safePlayOrPause_(callback)
122 : callback;
123
124 this.methods_[name] = wrappedCallback;
125 this.listenToOnce_();
126 }
127
128 /**
129 * @param {!JsonObject} data

Callers 3

listenToJwPlayer_Method · 0.95
listenToVideoJs_Method · 0.95

Calls 2

safePlayOrPause_Method · 0.95
userAssertFunction · 0.70

Tested by

no test coverage detected