Codeigniter beginner question
I got a codeigniter website what handles youtube 开发者_如何学运维videos.
Somet details are stored it the database, id, title, embed, thumbnail, description, duration.
I managed to show the list of videos.
And I would like that if someone clics on the thumbnail, it loads up the video.
Well I didn't had any luck with it.
I'm trying <a href='video?video_name_here'>thumbnail</a>
then go to the video page and show the video embed.
I don't want anybody to write it for me, i just only would like a more experienced persons help giving me a hint.
Thank you.
You must have videos controller with a play method that takes the video url as an argument. I appreciate you wanna try it so im just givin you a mock up here.
Class Videos extends CI_Controller {
function play($url) {
embed_play($url);
}
}
In your links in thumbnails do this
<?php echo anchor("videos/play/".$video_url,"Video 1"); ?>
Hope this helps
Why don't you try using Colorbox?
http://trueacu.com/YouTube_Colorbox
you'd have to create your link like this:
<a class="example6" href="http://www.youtube.com/embed/KWRB-maTVyM" title="Xampp Installation">
Xampp Installation Video on YouTube</a>
and you should also add this javascript:
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344});
});
//]]>
</script>
精彩评论