gpt4 book ai didi

google-chrome - HTML5视频标签,javascript检测播放状态?

转载 作者:行者123 更新时间:2023-12-01 09:36:35 26 4
gpt4 key购买 nike

您可以使用 javascript 来检测视频是否正在播放吗?暂停?还是停止了?

我知道浏览器下的VLC可以做到这一点,但是不知道没有VLC怎么做?

最佳答案

可以查询media对象获取播放状态:

http://www.w3.org/TR/2011/WD-html5-20110113/video.html#playing-the-media-resource

"A media element is said to be potentially playing when its paused attribute is false, the element has not ended playback, playback has not stopped due to errors, the element either has no current media controller or has a current media controller but is not blocked on its media controller, and the element is not a blocked media element."

关于google-chrome - HTML5视频标签,javascript检测播放状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6647168/

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