gpt4 book ai didi

angular - 在特定时间启动视频并跟踪视频

转载 作者:行者123 更新时间:2023-12-03 03:46:52 25 4
gpt4 key购买 nike

这是一个由两部分组成的问题。

我正在使用 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>

最佳答案

请参阅AMP docsAPI docs了解更多信息。

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);

关于angular - 在特定时间启动视频并跟踪视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68790149/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com