1

这是一个两部分的问题。

我正在使用Azure Media Player. 代码如下。我只是显示URL视频并开始播放。

  1. 我需要知道如何在特定时间播放视频(比如说 0.19 秒)

  2. 如何跟踪视频的播放时间

    <video oncontextmenu="return false;"  id="vid1" class="azuremediaplayer amp-default-skin" autoplay width="640" height="400"  data-setup='{"nativeControlsForTouch": false}'>
        <source src={{url}} >
    </video>
    
4

1 回答 1

0

有关详细信息,请参阅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);
于 2021-08-16T23:08:39.410 回答