diff options
author | Jesús <heckyel@hyperbola.info> | 2018-08-25 15:18:15 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2018-08-25 15:18:15 -0500 |
commit | eb44cce90b0a8910c3be03ab4ab85cfe11d6675c (patch) | |
tree | 9c5a6ef382b3d912f04762cbde61e67d298d05f1 | |
parent | f6671dd35860107c2c941287208eff9c1954c4a6 (diff) | |
download | ytlibre-eb44cce90b0a8910c3be03ab4ab85cfe11d6675c.tar.lz ytlibre-eb44cce90b0a8910c3be03ab4ab85cfe11d6675c.tar.xz ytlibre-eb44cce90b0a8910c3be03ab4ab85cfe11d6675c.zip |
Added embed video for share
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | embed/index.php | 48 | ||||
-rw-r--r-- | templates/embed.tpl | 52 |
3 files changed, 101 insertions, 0 deletions
@@ -10,4 +10,5 @@ templates/libs/jquery *.min.css.map ### Smarty ### templates_c/ +embed/templates_c/ *.tpl.php diff --git a/embed/index.php b/embed/index.php new file mode 100644 index 0000000..dcf8427 --- /dev/null +++ b/embed/index.php @@ -0,0 +1,48 @@ +<?php +require_once('../smarty/Smarty.class.php'); +$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/processor.php"; + $video_decode = new Smarty(); + + /* ---- ---- Variables ---- ---- */ + $video_decode->assign("titulo", $titulo); + $video_decode->assign("videoTitle", $videoTitle); + $video_decode->assign("videoThumbURL", $videoThumbURL); + $video_decode->assign("videoAuthor", $videoAuthor); + $video_decode->assign("videoDuration", $videoDuration); + $video_decode->assign("videoViews", $videoViews); + $video_decode->assign("librethumb", $librethumb); + + $video_decode->assign("cStreams", $cStreams); + $video_decode->assign("baselink", $baselink); + $video_decode->assign("videosStream", $videosStream); + + /* ---- ---- CSS ---- ---- */ + $video_decode->assign('styles', array('frond' => '../templates/css/frond.min.css', + 'normalize' => '../templates/css/normalize.css', + 'teal' => '../templates/libs/librevideojs/css/teal.css', + 'salida' => '../templates/css/salida.min.css') + ); + + /* ---- ---- JS ---- ---- */ + $video_decode->assign('javascript', array('librevideojs' => '../templates/libs/librevideojs/js/cliplibrejs.developer.js', + 'jquery' => '../templates/libs/jquery/dist/jquery.min.js') + ); + + $video_decode->display('../templates/embed.tpl'); +} diff --git a/templates/embed.tpl b/templates/embed.tpl new file mode 100644 index 0000000..c838200 --- /dev/null +++ b/templates/embed.tpl @@ -0,0 +1,52 @@ +<!DOCTYPE html> +<html lang="es"> + <head> + <meta charset="UTF-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <title>{$titulo} | {$videoTitle}</title> + <link rel="icon" href="templates/images/favicon.png" sizes="192x192" /> + <!--LibreVideoJS--> + <link href="{$styles.teal}" rel="stylesheet"/> + <script src="{$javascript.librevideojs}"></script> + </head> + <body> + <div class="librevideojs"> + <video id="example" controls poster="{$librethumb}" data-setup="{}"> + {foreach $videosStream as $stream} + {$stream = json_decode(json_encode($stream))} + <source data-res="{$stream->quality}" src="{$stream->url}" type="{$stream->libretype}"/> + {/foreach} + <p class="librevjs-no-js">Este navegador no soporta HTML 5.</p> + </video> + </div> + <!--LibreVideoJS--> + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-libre-mix-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "360p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }), + this.progressTips(); + }); + // @license-end + </script> + <!--LibreVideoJS--> + <script src="{$javascript.jquery}"></script> + </body> +</html> |