我有一个视频缩略图库,每个缩略图都有一个名为.video-overlay的叠加层,该叠加层调用带有动态视频的lity.js弹出窗口。
当视频在弹出窗口中加载时,我希望它自动开始播放。
这是带有视频formosapark-hotel.com/hotel-info/video-gallery /
的页面我已经尝试了很多事情,但是弹出窗口加载时我什至无法触发事件。
即使我可以模拟单击弹出窗口中显示的视频上的圆形按钮。
任何指针都非常感谢,因为我已经坚持了几个小时。
这是触发视频的html按钮的代码,是否可以通过jQuery执行此按钮?
<div class="jw-icon jw-icon-display jw-button-color jw-reset" role="button" tabindex="0" aria-label="Start Playback"><svg xmlns="http://www.w3.org/2000/svg" class="jw-svg-icon jw-svg-icon-buffer" viewBox="0 0 240 240" focusable="false"><path d="M120,186.667a66.667,66.667,0,0,1,0-133.333V40a80,80,0,1,0,80,80H186.667A66.846,66.846,0,0,1,120,186.667Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" class="jw-svg-icon jw-svg-icon-replay" viewBox="0 0 240 240" focusable="false"><path d="M120,41.9v-20c0-5-4-8-8-4l-44,28a5.865,5.865,0,0,0-3.3,7.6A5.943,5.943,0,0,0,68,56.8l43,29c5,4,9,1,9-4v-20a60,60,0,1,1-60,60H40a80,80,0,1,0,80-79.9Z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" class="jw-svg-icon jw-svg-icon-play" viewBox="0 0 240 240" focusable="false"><path d="M62.8,199.5c-1,0.8-2.4,0.6-3.3-0.4c-0.4-0.5-0.6-1.1-0.5-1.8V42.6c-0.2-1.3,0.7-2.4,1.9-2.6c0.7-0.1,1.3,0.1,1.9,0.4l154.7,77.7c2.1,1.1,2.1,2.8,0,3.8L62.8,199.5z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" class="jw-svg-icon jw-svg-icon-pause" viewBox="0 0 240 240" focusable="false"><path d="M100,194.9c0.2,2.6-1.8,4.8-4.4,5c-0.2,0-0.4,0-0.6,0H65c-2.6,0.2-4.8-1.8-5-4.4c0-0.2,0-0.4,0-0.6V45c-0.2-2.6,1.8-4.8,4.4-5c0.2,0,0.4,0,0.6,0h30c2.6-0.2,4.8,1.8,5,4.4c0,0.2,0,0.4,0,0.6V194.9z M180,45.1c0.2-2.6-1.8-4.8-4.4-5c-0.2,0-0.4,0-0.6,0h-30c-2.6-0.2-4.8,1.8-5,4.4c0,0.2,0,0.4,0,0.6V195c-0.2,2.6,1.8,4.8,4.4,5c0.2,0,0.4,0,0.6,0h30c2.6,0.2,4.8-1.8,5-4.4c0-0.2,0-0.4,0-0.6V45.1z"></path></svg></div>
答案 0 :(得分:1)
当我检查您的代码时,我发现了
<div id="video-overlay" style="cursor: pointer;margin-top:-183px;z-index:1;position:relative;height:150px;width:270px;margin-bottom:20px" href="#" data-lity="" data-lity-target="//media.videopolis.com/1.0/api/getById/eng/7b7638244aa2e970c94307f37c95187767354c3c.html?key=1a917ba295a7fb07&autoplay=false&mute=true&autoreplay=false&playlist=false&volume=30&mouseOverMode=false&blank="></div>
我想,如果您将autoplay = false更改为autoplay = true,那么您会得到想要的。