vimeo.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. $config = parse_ini_file('../config/config.ini',true);
  3. if(!isset($_COOKIE["session"]) || $_COOKIE["session"] != "true" || !$config["Media"]["vimeo"]) {
  4. http_response_code(403);
  5. die('Forbidden');
  6. }
  7. ?>
  8. <!DOCTYPE html>
  9. <html lang="en" style="height:100%">
  10. <head>
  11. <meta charset="utf-8">
  12. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  13. <script src="/assets/js/player/youplay.js"></script>
  14. </head>
  15. <body style="margin:0;height:100%;overflow:hidden">
  16. <?php
  17. include("vimeoclass.php");
  18. $vdata = vimeo(htmlspecialchars($_GET["id"]));
  19. if($vdata) {
  20. $vlink = $vdata["dl"];
  21. ?>
  22. <video class="video-js vjs-default-skin" controls id="player" poster="<?=$vdata["info"]["Thumbnail"]?>" title="<?=$vdata["info"]["Title"]?>" style="width:100%;height:100%">
  23. Your browser does not support the video tag.
  24. </video>
  25. <script>
  26. yp_player({share:false,use_desktop_skin:true,sources:[
  27. <?php
  28. for($i=0;$i<count($vlink);$i++) {
  29. echo "{src:'".$vlink[$i]["url"]."',label:'".$vlink[$i]["type"]."',audio:true},";
  30. }
  31. ?>
  32. ]});
  33. </script>
  34. <?php } else { ?>
  35. Sorry, there was an error while trying to load your video.
  36. <?php } ?>
  37. </body>
  38. </html>