Passing the supported video extension to a MYSQL query
Using Modernizr to pick the video type(s) I want to pass the supported file extension to the MYSQL query.
The following code decides which types will run
<script type="text/javascript">
$(document).ready(function()
{
if (Modernizr.video)
{
if (Modernizr.video.ogg) {
// $("#result").html('Your browser has support for ogg ');
}
if (Modernizr.video.webm) {
// $("#result2").html('Your browser has support for webm ');
}
if (Modernizr.video.h264){
// $("#result3").html('Your browser has support for h264');
}
}
else
{
// $("#result3").html('Your browser does not support video');
}
});
</script>
But how do I pass the correct extension ($ext) to the query?
$kazvideo1 = p4::find_kazand_by_cgs($id,$ext);
You have to understand that Javascript is executed on Client Side when mysql query is executed on Server side. The only solution now is to use AJAX and pass correct type as GET or POST value to your server side script that will return whatever you need i.e. list of available videos
Bookmarks