Unverified Commit e4a70b68 authored by fauno's avatar fauno

micrositio para transmisión de eventos

parents
node_modules/
.bundle/
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
concurrent-ruby (1.0.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
ffi (1.9.25)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.8.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-watch (2.1.1)
listen (~> 3.0)
kramdown (1.17.0)
liquid (4.0.1)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
pathutil (0.16.1)
forwardable-extended (~> 2.6)
public_suffix (3.0.3)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (3.3.0)
ruby_dep (1.5.0)
safe_yaml (1.0.4)
sass (3.6.0)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
PLATFORMS
ruby
DEPENDENCIES
jekyll
BUNDLED WITH
1.16.3
This diff is collapsed.
# Streaming
Genera un sitio que muestra un stream de video en distintos formatos a
partir de una fuente Icecast.
El sitio se encarga de recuperar la transmisión cuando se corta.
## Uso
Modificar el archivo `_config.yml`:
```yaml
title: MIAU Dev
lang: es
markdown: kramdown
streaming:
url: https://trans.kefir.red
stream: miaudev
formats:
- webm
- mp4
```
El parámetro `url` es la dirección base del servidor Icecast. `stream`
es el nombre del video, el `canal` en terminología de Icecast.
Los `formats` son los formatos de video disponibles, al menos tiene que
haber uno.
Colocar en el archivo `assets/cover.jpg` la portada de los videos.
title: MIAU Dev
lang: es
markdown: kramdown
streaming:
url: https://trans.kefir.red
stream: miaudev
formats:
- webm
- mp4
<!DOCTYPE html>
<html lang="{{ site.lang }}">
<head>
<meta charset="UTF-8">
<title>{{ site.title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="assets/main.css" rel="stylesheet" />
<script type="text/javascript" src="assets/streaming.js"></script>
</head>
<body>
{{ content }}
</body>
</html>
# Crea un tag de Liquid que busca un archivo dentro del directorio
# node_modules y lo incorpora tal cual
module Jekyll
class NodeModulesTag < Liquid::Tag
def initialize(tag, markup, tokens)
super
@file = File.join('node_modules', markup.strip)
end
def render(context)
File.read @file
end
end
end
# Registrar el tag
Liquid::Template.register_tag('node_module', Jekyll::NodeModulesTag)
html, body {
margin: 0;
padding: 0;
}
/* Ver el video en pantalla completa */
.full video {
width: 100vw;
height: 100vh;
}
This diff is collapsed.
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'jekyll' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
bundle_binstub = File.expand_path("../bundle", __FILE__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("jekyll", "jekyll")
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>MIAU Dev</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="assets/main.css" rel="stylesheet" />
<script type="text/javascript" src="assets/streaming.js"></script>
</head>
<body>
<div class="full">
<video controls autoplay="false" poster="assets/cover.jpg">
<source src="https://trans.kefir.red/miaudev.webm"
id="webm"
type="video/webm"/>
<source src="https://trans.kefir.red/miaudev.mp4"
id="mp4"
type="video/mp4"/>
</video>
</div>
</body>
</html>
{
"dependencies": {
"zepto": "^1.2.0"
}
}
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
zepto@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/zepto/-/zepto-1.2.0.tgz#e127bd9e66fd846be5eab48c1394882f7c0e4f98"
---
---
html, body {
margin: 0;
padding: 0;
}
/* Ver el video en pantalla completa */
.full video {
width: 100vw;
height: 100vh;
}
---
---
// TODO hacerlo en JS puro
{% node_module zepto/dist/zepto.min.js %}
function streaming_for_firefox() {
// Encontrar todos los <video>
var video = $('video');
// Cambiar el src para que incluya un timestamp, esto engaña a Firefox
// a recargar el video cuando se corta en lugar de pensar que terminó
// la descarga y empezar a reproducir desde el principio.
video.find('source').attr('src', function() {
var source = $(this);
// Obtener la URL completa hasta el ?
var src = source.attr('src').split('?')[0];
return src+'?'+Date.now().toString();
});
// Empezar la reproducción
video.get(0).load();
video.get(0).play();
}
// Iniciar el streaming al cargar la página
$(document).ready(function() {
streaming_for_firefox();
});
// Volver a reproducir cuando se corte
$('video').on('ended', function() {
streaming_for_firefox();
});
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'jekyll' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
bundle_binstub = File.expand_path("../bundle", __FILE__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("jekyll", "jekyll")
---
layout: default
---
<div class="full">
<video controls autoplay="false" poster="assets/cover.jpg">
{% for format in site.streaming.formats %}
<source src="{{ site.streaming.url }}/{{ site.streaming.stream }}.{{ format }}"
id="{{ format }}"
type="video/{{ format }}"/>
{% endfor %}
</video>
</div>
{
"dependencies": {
"zepto": "^1.2.0"
}
}
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
zepto@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/zepto/-/zepto-1.2.0.tgz#e127bd9e66fd846be5eab48c1394882f7c0e4f98"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment