问题描述
我正在网站上使用 flexslider ,并将youtube视频放在某些幻灯片中.但是,我需要滑块在视频播放时停止动画播放,并在视频播放结束后恢复动画播放.我了解开发人员已使用vimeo API为该确切问题提供了解决方案.是否有使用youtube API实施的示例?是否有可能?我(显然)不是一名JavaScript专家,并且发现我通过示例/教程学得最好.
I am using flexslider on a site and will be putting youtube videos in certain slides. However, I need the slider to stop animating while the video is playing, and resume when the video finishes. I understand that the developer has provided a solution to this exact problem using the vimeo API. Are there examples out there of an implementation using the youtube APIs? Is it possible? I am (obviously) not a javascript expert, and find that I learn best through examples/tutorials.
推荐答案
在 https:上有一个示例: //developers.google.com/youtube/iframe_api_reference#Getting_Started ,用于将iframe YouTube播放器嵌入页面并响应特定事件.我认为您应该能够对此进行调整以满足您的需求.
There's an example at https://developers.google.com/youtube/iframe_api_reference#Getting_Started for embedding an iframe YouTube player on a page, and responding to specific events. I think you should be able to adapt that to meet your needs.
这篇关于在Flexslider幻灯片中播放YouTube视频并暂停幻灯片放映的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!