Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $tipos=array("webm","mp4","ogv","jpg");
- $dirActual=dirname(__FILE__);
- $videos=array();
- foreach($tipos as $tipo){
- foreach(scandir($dirActual.$tipo) as $archivo){
- if($archivo!="." && $archivo!=".."){
- $a=pathinfo($dirActual.$tipo.$archivo,PATHINFO_FILENAME)
- $videos[$tipo][$a['filename']]=basename($archivo);
- }
- }
- }
- foreach($videos['jpg'] as $poster){
- ?>
- <video id="<?php print $poster?>" width="800" height="450" poster="jpg/<?php print $poster?>" controls="controls" preload="none">
- <source type="video/mp4" src="mp4/<?php print $poster?>.mp4" />
- <source type="video/webm" src="webm/<?php print $poster?>.webm" />
- <source type="video/ogg" src="ogv/<?php print $poster?>.ogv" />
- </video>
- <?php
- }
- ?>
Add Comment
Please, Sign In to add comment