embed.php 989 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once '../inc/global.inc.php';
  4. $type = $_REQUEST['type'];
  5. $src = Security::remove_XSS($_REQUEST['src']);
  6. if (empty($type) || empty($src)) {
  7. api_not_allowed();
  8. }
  9. switch ($type) {
  10. case 'youtube':
  11. $src = 'http://www.youtube.com/embed/'.$src;
  12. $iframe = '<iframe class="youtube-player" type="text/html" width="640" height="385" src="'.$src.'" frameborder="0"></iframe>';
  13. break;
  14. case 'vimeo':
  15. $src = 'http://player.vimeo.com/video/'.$src;
  16. $iframe = '<iframe src="'.$src.'" width="640" height="385" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
  17. break;
  18. }
  19. ?>
  20. <!doctype html>
  21. <html>
  22. <head>
  23. <meta charset="utf-8">
  24. <title></title>
  25. </head>
  26. <body>
  27. <div id="content" style="width: 700px ;margin-left:auto; margin-right:auto;">
  28. <br />
  29. <?php echo $iframe; ?>
  30. </div>
  31. </body>
  32. </html>