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

Method update

ads/google/ima/ima-player-data.js:21–32  ·  view source on GitHub ↗

* Update from the provided video player. * * @param {!Element} videoPlayer

(videoPlayer)

Source from the content-addressed store, hash-verified

19 * @param {!Element} videoPlayer
20 */
21 update(videoPlayer) {
22 this.currentTime = videoPlayer.currentTime;
23 this.duration = videoPlayer.duration;
24
25 // Adapt videoPlayer.played for the playedRanges format AMP wants.
26 const {played} = videoPlayer;
27 const {length} = played;
28 this.playedRanges = [];
29 for (let i = 0; i < length; i++) {
30 this.playedRanges.push([played.start(i), played.end(i)]);
31 }
32 }
33}
34
35/**

Callers 1

playerDataTickFunction · 0.45

Calls 2

pushMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected