-
Notifications
You must be signed in to change notification settings - Fork 2
/
media-plyr.html.twig
79 lines (65 loc) · 2.28 KB
/
media-plyr.html.twig
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{% extends '@nucleus/partials/particle.html.twig' %}
{# Recuperando el campo AutoReproducir #}
{% if particle.AutoReproducir %}
{% set AutoReproducir = "true" %}
{% else %}
{% set AutoReproducir = "false" %}
{% endif %}
{# Recuperando el campo Patallacompleta #}
{% if particle.PantallaCompleta %}
{% set PantallaCompleta = "true" %}
{% else %}
{% set PantallaCompleta = "false" %}
{% endif %}
{% block particle %}
<div class="g-media-plyr g-{{id}}">
{# Título de la partícula #}
{% if particle.Titulo %}
<{{particle.EtiquetaTitulo}}{% if particle.ClaseCssTitulo %} class="{{particle.ClaseCssTitulo}}"{% endif %}>
{{-particle.Titulo-}}
</{{particle.EtiquetaTitulo}}>
{% endif %}
{# Videos Propios en MP4 o WEBM #}
{% if particle.VideoMp4 or particle.VideoWebm %}
<video {% if particle.ImagenPrevia %}poster="{{url(particle.ImagenPrevia)}}"{% endif %} controls>
{% if particle.VideoMp4 %}
<source src="{{url(particle.VideoMp4)}}" type="video/mp4">
{% endif %}
{% if particle.VideoWebm %}
<source src="{{url(particle.VideoWebm)}}" type="video/webm">
{% endif %}
</video>
{% endif %}
{# Audios Propios en MP3 o OGG #}
{% if particle.AudioMp3 or particle.AudioOgg %}
<audio controls>
{% if particle.AudioMp3 %}
<source src="{{url(particle.AudioMp3)}}" type="audio/mp3">
{% endif %}
{% if particle.AudioOgg %}
<source src="{{url(particle.AudioOgg)}}" type="audio/ogg">
{% endif %}
</audio>
{% endif %}
{# Videos de YOUTUBE O VIMEO #}
{% if 'youtube' in particle.UrlVideo %}
<div data-type="youtube" data-video-id="{{url(particle.UrlVideo)}}"></div>
{% endif %}
{% if 'vimeo' in particle.UrlVideo %}
<div data-type="vimeo" data-video-id="{{url(particle.UrlVideo)}}"></div>
{% endif %}
</div>
{% assets in 'head' with { priority: 0 } %}
<link rel="stylesheet" href="{{ url('gantry-theme://css/plyr.css') }}" type="text/css"/>
{% endassets %}
{% assets in 'footer' with { priority: 0 } %}
<script type="text/javascript" src="{{ url('gantry-theme://js/plyr.js') }}"></script>
<script>
var player = plyr.setup('.g-{{id}}',{
autoplay: {{AutoReproducir}},
fullscreen:{enabled:{{PantallaCompleta}}},
iconUrl:"{{ url('gantry-theme://css/plyr.svg') }}"
});
</script>
{% endassets %}
{% endblock %}