Ich lese Video-Daten aus SQL-Tabelle.Öffnen Sie ein Youtube-Video in Bootstrap-Modal-Box
Felder in tha Tabelle: - sidebar_video_id (Autoinkrement) - sidebar_video_nev - sidebar_video_link (vollständige URL) - sidebar_video_v_id (Video-ID von am url Ende)
Was ich will, ist, wenn ich klicken Auf jedem Video wird es geöffnet und in einer bootstrap-modalen Box abgespielt. Jetzt öffnet sich die Box, aber sie ist leer und ich bekomme keine Konsolenfehler.
<?php
$get_videos = mysqli_query($kapcs, "SELECT * FROM sidebar_video");
if(mysqli_num_rows($get_videos) > 0)
{
while($vid = mysqli_fetch_assoc($get_videos))
{
echo '<div class="sidebar_youtube_box">';
echo '<a href="#" id="'.$vid['sidebar_video_v_id'].'" data-url="'.$vid['sidebar_video_link'].'" class="open_youtube_modal" title="'.$vid['sidebar_video_nev'].'"><img src="http://img.youtube.com/vi/'.$vid['sidebar_video_v_id'].'/hqdefault.jpg" class="img-responsive"></a>';
echo '</div>';
}
}
?>
<div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Bezárás</span></button>
<h4 class="modal-title" id="myModalLabel">Videó megtekintése</h4>
</div>
<div class="modal-body" id="video_modal_body">
</div>
</div>
</div>
</div>
$('.open_youtube_modal').click(function(e) {
e.preventDefault();
var v_id = $(this).attr('id');
var full_url = $(this).attr('data-url');
var embed_html = '<iframe width="560" height="315" src="' + full_url + '" frameborder="0" allowfullscreen></iframe>';
//alert(embed_html);
$('#video_modal_body').html(embed_html);
$('#videoModal').modal('show');
});
'full_url' Rückgabewert?/irgendein Fehler im Konsolen- oder PHP-Fehlerprotokoll? – Pedram