javascript - Play Video in Bootstrap Modal Popup - Stack Overflow

I am trying to play a mp4 videoin the bootstrap modal pop-up.The video is placed in the folder of my

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
Add a ment  | 

1 Answer 1

Reset to default 1

Try 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745277548a4620126.html

相关推荐

  • javascript - Play Video in Bootstrap Modal Popup - Stack Overflow

    I am trying to play a mp4 videoin the bootstrap modal pop-up.The video is placed in the folder of my

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信