index.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. require_once('../smarty/Smarty.class.php');
  3. define('ROOT_PATH', preg_replace('/index.php/', '', $_SERVER["DOCUMENT_ROOT"].$_SERVER["DOCUMENT_URI"]));
  4. define('TOOLS_PATH', preg_replace('|\/embed|', '', ROOT_PATH.'tools/') );
  5. $titulo="YTLibre";
  6. $template= new Smarty();
  7. /* ---- ---- Variables ---- ---- */
  8. $template->assign("titulo", $titulo);
  9. /* ---- ---- CSS ---- ---- */
  10. $template->assign('styles', array('frond' => '../templates/css/frond.min.css',
  11. 'normalize' => '../templates/css/normalize.css')
  12. );
  13. /* ---- ---- ---- Generated ---- ---- ---- ---- */
  14. if (empty($_GET['link'])){
  15. $template->display('../templates/index.tpl');
  16. } else {
  17. /* ---- ---- video-generated ---- ---- */
  18. require_once ( TOOLS_PATH.'processor.php' );
  19. $video_decode = new Smarty();
  20. /* ---- ---- Variables ---- ---- */
  21. $video_decode->assign("titulo", $titulo);
  22. $video_decode->assign("videoTitle", $videoTitle);
  23. $video_decode->assign("videoThumbURL", $videoThumbURL);
  24. // Videos Loop
  25. $video_decode->assign("streamFormats", $streamFormats);
  26. // Live
  27. $video_decode->assign("islive", $islive);
  28. /* ---- ---- CSS ---- ---- */
  29. $video_decode->assign('styles', array('frond' => '../templates/css/frond.min.css',
  30. 'normalize' => '../templates/css/normalize.css',
  31. 'plyr' => '../templates/libs/plyr/plyr.css',
  32. 'salida' => '../templates/css/salida.min.css')
  33. );
  34. /* ---- ---- JS ---- ---- */
  35. $video_decode->assign('javascript', array('plyr' => '../templates/libs/plyr/plyr.embed.min.js')
  36. );
  37. $video_decode->display('../templates/embed.tpl');
  38. }