aboutsummaryrefslogtreecommitdiffstats
path: root/embed/index.php
blob: ca2f36c54ec956c5fd0e235ccb77db878dd6b085 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
require_once('../smarty/Smarty.class.php');

define('ROOT_PATH', preg_replace('/index.php/', '', $_SERVER["DOCUMENT_ROOT"].$_SERVER["DOCUMENT_URI"]));
define('TOOLS_PATH', preg_replace('|\/embed|', '', ROOT_PATH.'tools/') );

$titulo="YTLibre";
$template= new Smarty();

/* ---- ---- Variables ---- ---- */
$template->assign("titulo", $titulo);

/* ---- ---- CSS ---- ---- */
$template->assign('styles', array('frond' => '../templates/css/frond.min.css',
                                  'normalize' => '../templates/css/normalize.css')
);

/* ---- ---- ---- Generated ---- ---- ---- ---- */
if (empty($_GET['link'])){
    $template->display('../templates/index.tpl');
} else {
    /* ---- ---- video-generated ---- ---- */
    require_once ( TOOLS_PATH.'processor.php' );
    $video_decode = new Smarty();

    /* ---- ---- Variables ---- ---- */
    $video_decode->assign("titulo", $titulo);
    $video_decode->assign("videoTitle", $videoTitle);
    $video_decode->assign("videoThumbURL", $videoThumbURL);

    // Videos Loop
    $video_decode->assign("streamFormats", $streamFormats);

    // Live
    $video_decode->assign("islive", $islive);

    /* ---- ---- CSS ---- ----  */
    $video_decode->assign('styles', array('frond' => '../templates/css/frond.min.css',
                                          'normalize' => '../templates/css/normalize.css',
                                          'plyr' => '../templates/libs/plyr/plyr.css',
                                          'salida' => '../templates/css/salida.min.css')
    );

    /* ---- ---- JS ---- ---- */
    $video_decode->assign('javascript', array('plyr' => '../templates/libs/plyr/plyr.embed.min.js')
    );

    $video_decode->display('../templates/embed.tpl');
}