2016-07-25 75 views
-1

我試圖在Bootstrap模式彈出窗口中播放mp4視頻。在Bootstrap模式彈出窗口中播放視頻

該視頻被放置在我的項目文件夾中。

的問題是,當我從項目的文件夾中的視頻的路徑,沒有任何反應即視頻無法播放:

這裏是彈出enter image description here

我試圖快照下面的代碼:

<!-- 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> 

但是,如果我改變的Src像一些事情:

http://techslides.com/demos/sample-videos/small.mp4 

播放視頻。

可能是什麼問題?

由於視頻播放良好時,我從任何在線鏈接給源。

請幫幫我。

在此先感謝

編輯:

我也試過video標籤,而不是iframe但仍然問題是相同的,如果我給從文件夾中的源:

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

回答

0

嘗試更換帶有「視頻」和「源」標籤的iframe如下所示。

<video autoplay loop class="embed-responsive-item"> 
<!--replace this sample with your video--> 
<source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4"> 
</video> 

請仔細檢查你的路徑。這個對我有用。

+0

它也適用於我,如果我給任何在線鏈接的路徑..但​​是當我從本地文件夾給視頻的路徑,沒有任何反應。 –

+0

我編輯了我的問題,你可以看到它,我已經用你建議的方法添加了代碼 –

+0

嗯。真奇怪。你可以嘗試使用你的路徑,如'http:// localhost/Departments/HR/Presentations/Credit/csp_pre.mp4' – Vince

相關問題