gpt4 book ai didi

javascript - 如何改变HTML5中视频的播放速度?

转载 作者:搜寻专家 更新时间:2023-10-31 19:30:27 25 4
gpt4 key购买 nike

如何在 HTML5 中改变视频播放速度?我检查过video tag's attributes在 w3school 但无法接近。

最佳答案

根据 this site ,这在 playbackRatedefaultPlaybackRate 属性中受支持,可通过 DOM 访问。示例:

/* play video twice as fast */
document.querySelector('video').defaultPlaybackRate = 2.0;
document.querySelector('video').play();

/* now play three times as fast just for the heck of it */
document.querySelector('video').playbackRate = 3.0;

以上works适用于 Chrome 43+、Firefox 20+、IE 9+、Edge 12+。

关于javascript - 如何改变HTML5中视频的播放速度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45211635/

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