简体   繁体   English

获取 HTML5 中视频元素的控件(洗涤器)元素

[英]Get element of controls (scrubber) of a video element in HTML5

When generating a standard video object in HTML5 you can activate standard controls for it.在 HTML5 中生成标准视频 object 时,您可以为其激活标准控件。 When using an inspect tool of a browser I see that the element I am looking for is called a scrubber, which is the timeline that shows where the video is standing at (and start and end position).当使用浏览器的检查工具时,我看到我正在寻找的元素称为擦洗器,它是显示视频所在位置(以及开始和结束位置)的时间线。 My browser says that this element is named input#scrubber.scrubber.我的浏览器说这个元素被命名为 input#scrubber.scrubber。 How can it be accessed through javascript?如何通过javascript访问? I need to get its starting and ending x positions, which should not be a problem once I can get the element.我需要得到它的开始和结束 x 位置,一旦我能得到元素,这应该不是问题。 I tried document.getElementsByClassName and document.querySelectorAll to search for it but somehow did it wrong.我尝试了 document.getElementsByClassName 和 document.querySelectorAll 来搜索它,但不知何故做错了。

That's part of the browser's Shadow DOM / pseudo-elements.这是浏览器 Shadow DOM / 伪元素的一部分。 You can't access them by javascript - see this post .您无法通过 javascript 访问它们 - 请参阅此帖子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM