有关详细信息,请参阅AMP 文档和API 文档。
var myPlayer = amp("vid1", function(){
//this is the ready function and will only execute after the player is loaded
myPlayer.currentTime(19); // immediately after the video is ready, this will set the time to 19 seconds
});
// in this case, assume `startCounter` and `stopCounter` are functions
// you created that start and pause a timer to keep track of how long someone
// has actually been playing the content.
myPlayer.addEventListener(amp.eventName.play, startCounter);
myPlayer.addEventListener(amp.eventName.pause, pauseCounter);
// or use `timeupdate` if you would rather just keep track of the current
// playback position.
myPlayer.addEventListener(amp.eventName.timeupdate, someFunc);