2017-10-03 1 views
1

Ich habe eine Flowplayer-Bibliothek. Jetzt möchte ich, wenn ich auf einen Link klicke, alle meine Videos im Modal Box Popup auflisten. Ich habe alles versucht, aber es funktioniert nicht. Ich bin nicht in der Lage herauszufinden, was eigentlich falsch ist.Video abspielen in Modal-Box Pop-Up

Wenn ich die Videos ohne Popup lade funktioniert es gut, aber wenn ich versuchte, es in das Pop-up zu laden. Es wird nichts angezeigt. Bitte hilf mir jemand. Im Folgenden finden Sie JavaScript-Code ...

function show_samples(artist_id, language){ 
 
    $("#sample-box").load("<?php echo SITE_PATH?>index.php?rt=artist/show_vo_samples", {'artist_id':artist_id, 'language':language} , function(responseTxt, statusTxt, xhr){ 
 
     if(statusTxt == "success") 
 
      $('#sample-box').modal(); 
 
     if(statusTxt == "error") 
 
      alert("Error: " + xhr.status + ": " + xhr.statusText); 
 
    }); 
 
}
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script> 
 
<script src="../libraries/video_player/flowplayer.min.js"></script> 
 
<div id="sample-box" class="modal fade" role="dialog"> 
 
    <div class="modal-dialog"> 
 
     <!-- Modal content--> 
 
     <div class="modal-content"> 
 
      <div class="flowplayer" data-swf="../libraries/video_player/flowplayer.swf" data-ratio="0.4167"> 
 
      <video> 
 
       <source type="video/mp4" src="https://edge.flowplayer.org/bauhaus.mp4"> 
 
      </video> 
 
      </div> \t \t \t 
 
     </div> 
 
    </div> 
 
</div>

enter image description here

Antwort

1

function show_samples(artist_id, language){ 
 
    $("#sample-box").load("<?php echo SITE_PATH?>index.php?rt=artist/show_vo_samples", {'artist_id':artist_id, 'language':language} , function(responseTxt, statusTxt, xhr){ 
 
     if(statusTxt == "success") 
 
      $('#sample-box').modal(); 
 
     if(statusTxt == "error") 
 
      alert("Error: " + xhr.status + ": " + xhr.statusText); 
 
    }); 
 
}
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script> 
 

 
<script src="http://releases.flowplayer.org/js/flowplayer-3.2.12.min.js"> 
 
</script> 
 

 

 
<div id="sample-box" class="modal fade" role="dialog"> 
 
    <div class="modal-dialog"> 
 
     <!-- Modal content--> 
 
     <div class="modal-content"> 
 
      <div class="flowplayer" data-swf="http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf" data-ratio="0.4167"> 
 
      <video controls loop autoplay> 
 
      
 
      <source type="video/mp4" src="https://edge.flowplayer.org/bauhaus.mp4">   
 
     
 
      </video> 
 
      </div> \t \t \t 
 
     </div> 
 
    </div> 
 
</div>

+0

@Hi Tarang, was die Änderungen, die Sie machen. Bitte erkläre? –

+0

. Danke Mate..Ja jetzt funktioniert es gut. Ich denke, du fügst hinzu "steuert Schleife Autoplay". Aber ich möchte nicht automatisch Video abspielen, weil es eine Liste von 4 bis 5 Videos im Popup –

+0

'Autoplay' entfernt –