admin管理员组文章数量:1417667
I am trying to play a mp4 video in the bootstrap modal pop-up.
The video is placed in the folder of my project.
The problem is , when I give the path of the video from the project's folder , nothing happens i.e. the video is not played :
Here is the snapshot of the pop-up
I tried the following code :
<!-- Modal HTML -->
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h5 class="modal-title">SECRETS OF SUPERIOR CUSTOMER SERVICE (July 22, 2016)</h5>
</div>
<div class="modal-body">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="<%= ResolveUrl("~") %>Departments/HR/Presentations/Credit/csp_pre.mp4"></iframe>
</div>
</div>
</div>
</div>
</div>
But , if I change the Src to some thing like :
.mp4
The video is played .
What could be the problem ?
as the video is playing fine when I give the source from any online link.
Please help me .
Thanks in advance
EDIT:
I also tried video
tag instead of iframe
but still problem is same if i give the source from folder :
<div class="modal-body">
<div class="embed-responsive embed-responsive-16by9">
<video autoplay loop class="embed-responsive-item">
<source src="<%= ResolveUrl("~") %>Departments/HR/Presentations/Credit/csp_pre.mp4" type="video/mp4">
</video>
</div>
</div>
I am trying to play a mp4 video in the bootstrap modal pop-up.
The video is placed in the folder of my project.
The problem is , when I give the path of the video from the project's folder , nothing happens i.e. the video is not played :
Here is the snapshot of the pop-up
I tried the following code :
<!-- Modal HTML -->
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h5 class="modal-title">SECRETS OF SUPERIOR CUSTOMER SERVICE (July 22, 2016)</h5>
</div>
<div class="modal-body">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="<%= ResolveUrl("~") %>Departments/HR/Presentations/Credit/csp_pre.mp4"></iframe>
</div>
</div>
</div>
</div>
</div>
But , if I change the Src to some thing like :
http://techslides./demos/sample-videos/small.mp4
The video is played .
What could be the problem ?
as the video is playing fine when I give the source from any online link.
Please help me .
Thanks in advance
EDIT:
I also tried video
tag instead of iframe
but still problem is same if i give the source from folder :
<div class="modal-body">
<div class="embed-responsive embed-responsive-16by9">
<video autoplay loop class="embed-responsive-item">
<source src="<%= ResolveUrl("~") %>Departments/HR/Presentations/Credit/csp_pre.mp4" type="video/mp4">
</video>
</div>
</div>
Share
Improve this question
edited Jul 26, 2016 at 4:25
Alina Anjum
asked Jul 25, 2016 at 11:00
Alina AnjumAlina Anjum
1,2306 gold badges31 silver badges57 bronze badges
1 Answer
Reset to default 1Try to replace iframe with "video" and "source" tags as show below.
<video autoplay loop class="embed-responsive-item">
<!--replace this sample with your video-->
<source src="http://techslides./demos/sample-videos/small.mp4" type="video/mp4">
</video>
double check your path please. It works for me.
本文标签: javascriptPlay Video in Bootstrap Modal PopupStack Overflow
版权声明:本文标题:javascript - Play Video in Bootstrap Modal Popup - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745277548a2651271.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论