如何弹出 jquery 窗口来播放 vimeo/youtube 视频?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10916063/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to popup jquery window to play vimeo/youtube video?
提问by anc1revv
I'm building the landing page for an iPhone app, and i would like to add a video modal window to our page. It would be very similar to: https://path.com/.
我正在为 iPhone 应用程序构建登录页面,我想向我们的页面添加一个视频模式窗口。它非常类似于:https: //path.com/。
I found this page "Popup Jquery window to play youtube"but i don't know how to decrease the size of the video (I don't want it playing full screen).
我找到了这个页面“播放 youtube 的弹出 Jquery 窗口”,但我不知道如何减小视频的大小(我不希望它全屏播放)。
回答by Arrch
It's easy to use something like colorbox
You need to add JQueryfollowed by colorbox scripts to your html page,
then
使用类似colorbox 的东西很容易
你需要在你的 html 页面中添加JQuery,然后添加colorbox 脚本,然后
<a href="your_youtube_link" class="video_layer">play me</a>
<script>
$('.video_layer').colorbox({iframe:true});
</script>
Get the youtube link from the embedding tab below the video on youtube, you can set there the width and height of the frame.
从 youtube 上视频下方的嵌入选项卡获取 youtube 链接,您可以在那里设置框架的宽度和高度。