javascript 我可以使用 magnific-popup 来显示 MP4 视频吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20987334/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 19:46:02  来源:igfitidea点击:

Can I use magnific-popup to display an MP4 video?

javascriptjqueryhtml5-videomp4magnific-popup

提问by Anita Graham

I would like to use magnifico-popup to display a locally hosted mp4 file.

我想使用 magnifico-popup 来显示本地托管的 mp4 文件。

Do I need to define an iframe pattern for this or is there a simpler option.

我需要为此定义一个 iframe 模式还是有更简单的选择。

Many thanks for your thoughts

非常感谢您的想法

Anita

安妮塔

回答by Dmitry Semenov

You'll need to integrate some third-party video player, for example http://mediaelementjs.com/

您需要集成一些第三方视频播放器,例如http://mediaelementjs.com/

I'd recommend to use inlinetype of popup, as it allows you to open in popup any HTML code. http://dimsemenov.com/plugins/magnific-popup/documentation.html#inline-type

我建议使用inline弹出窗口类型,因为它允许您在弹出窗口中打开任何 HTML 代码。http://dimsemenov.com/plugins/magnific-popup/documentation.html#inline-type

Related example: http://codepen.io/dimsemenov/pen/GtjBb

相关示例:http: //codepen.io/dimsemenov/pen/GtjBb

回答by Sky Yip

You can use the type of content - iframeto open MP4 video:

您可以使用内容类型 - iframe打开 MP4 视频:

<a class="mfp-iframe" href="MP4_VIDEO_PATH">Open MP4 video in iframe</a>