* Update from the provided video player. * * @param {!Element} videoPlayer
(videoPlayer)
| 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 | /** |
no test coverage detected