madhawaseeeee

example_sorting video

May 8th, 2015
807
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>example</title>
  6.  
  7. <style>
  8. .clip{
  9. border:2px solid rgb(204,204,204);
  10. width:500px;
  11. height:350px;
  12. margin-bottom:10px;
  13. }
  14.  
  15. </style>
  16. </head>
  17.  
  18. <body>
  19. <div class="content">
  20. <?php
  21.  
  22. $vlist=array();
  23.  
  24. //assume there is a folder named videos and it contains all the videos
  25. foreach (glob("./videos/*") as $filename) {
  26. $vlist[]=$filename;
  27. }
  28.  
  29. //sort videos
  30. sort($vlist);
  31.  
  32. //inject video to html content
  33. foreach($vlist as $vid) {;
  34. echo "<div class='clip'><video width='500' height='350' controls><source src='{$vid}' type='video/mp4'></video> </div>";
  35. }
  36.  
  37. ?>
  38. </div>
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment