In order to detect the correct video codec to use, you need to check if the user's device supports one of the formats that you have encoded the video in. Let's assume you have all of your videos encoded in MP4 (H.264/AAC) and WMV (Version 7+). You could use the following code to display the supported streaming video format:
- Code: Select all
<?php
$wurflObj = new TeraWurfl();
$wurflObj->getDeviceCapabilitiesFromAgent();
if($wurflObj->capabilities['streaming']['streaming_video']){
if($wurflObj->capabilities['streaming']['streaming_mp4']){
echo "file.mp4";
}elseif($wurflObj->capabilities['streaming']['streaming_wmv'] >= 7){
echo "file.wmv";
}
}else{
echo "Streaming video is not supported";
}
?>
A complete list of the available capabilities is
available here.