eT` Posted January 24, 2010 Report Share Posted January 24, 2010 Tātad gribu embeddot klipus savā webā un gribu 2 dažādus veidus. 1. ja tu ieliec .flv linku ( video atskaņojas caur manu player.swf ) 2. ja tu ieliec linku ( piem. no youtubes ), tad izpildās f-ja, kas pārveido linku par embed. Man vajag pārbaudi, kas nosaka vai iepostototajā linkā ir .flv un ja ir tad attiecīgi atskaņo bet ja nav tad atskaņo kā linku. Pašlaik esmu ticis šeit: $code = $rowe["code"]; if(empty(strpos($code, ".flv"))) { $video=new video_embed(); $video->embed($code); } else { ?> <embed type="application/x-shockwave-flash" src="include/player.swf" id="mpl" name="mpl" quality="high" allowfullscreen="true" flashvars="file=<?=$code?>&height=420&width=500&location=include/player.swf &showdigits=true&shownavigation=true&type=flv&usekeys=false" height="420" width="500"> <? } bet ar empty, nekas nenotiek. kā var noteikt vai tur ir .flv? Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted January 24, 2010 Report Share Posted January 24, 2010 Nesalīdzini ar empty(), bet gan ar ===. + tev, teorētiski, vajadzētu paskatīties tikai pēdējos četrus simbolus. Ja tie ir .flv, tad dara vienu, ja nē, tad otru. Tam vari izmantot substr. Quote Link to comment Share on other sites More sharing options...
briedis Posted January 24, 2010 Report Share Posted January 24, 2010 function getFileExtension($file_name){ $info = pathinfo($file_name); return $info['extension']; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.