vimeo.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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="image.php?url=<?=urlencode($vdata["info"]["Thumbnail"])?>" title="<?=$vdata["info"]["Title"]?>" style="width:100%;height:100%">
  23. <?php
  24. for($i=0;$i<count($vdata["info"]["Captions"]);$i++) {
  25. echo "<track kind='captions' label='".$vdata["info"]["Captions"][$i]["title"]."' src='vimeocaption.php?url=".urlencode($vdata["info"]["Captions"][$i]["url"])."'>";
  26. }
  27. ?>
  28. Your browser does not support the video tag.
  29. </video>
  30. <script>
  31. yp_player({share:false,use_desktop_skin:true,sources:[
  32. <?php
  33. for($i=0;$i<count($vlink);$i++) {
  34. echo "{src:'".$vlink[$i]["url"]."',label:'".$vlink[$i]["type"]."',audio:true},";
  35. }
  36. ?>
  37. ],thumbnails:JSON.parse('<?=json_encode($vdata["info"]["Thumbs"])?>')});
  38. </script>
  39. <?php } else { ?>
  40. Sorry, there was an error while trying to load your video.
  41. <?php } ?>
  42. </body>
  43. </html>