null
Atzealdea
Prueba Page Banner Video
Errorea gertatu da txantiloia prozesatzerakoan.
The following has evaluated to null or missing: ==> phoneImagen [in template "20192#20219#287217" at line 25, column 24] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${phoneImagen.getData()} [in template "20192#20219#287217" at line 25, column 22] ----
1<style>
2
3 #p_p_id${renderResponse.getNamespace()} .portlet-title-text { display:none;}
4</style>
5
6<div class="gso__banner">
7 <#if playPause?? && playPause.getData()?has_content && getterUtil.getBoolean(playPause.getData())>
8 <#if VideoURL?? && VideoURL.getData()?has_content>
9 <button class="play_pause" type="button" onclick="playpause()" title="<@liferay_ui["message"] key="playpause.stop" />" aria-label="<@liferay_ui["message"] key="playpause.stop" />" style="z-index: 1"><i class="icon-pause"></i></button>
10 </#if>
11 <#if youtubeUrl?? && youtubeUrl.getData()?has_content>
12 <button class="play_pause" type="button" onclick="playpauseYT()" title="<@liferay_ui["message"] key="playpause.stop" />" aria-label="<@liferay_ui["message"] key="playpause.stop" />" style="z-index: 1"><i class="icon-pause"></i></button>
13 </#if>
14 </#if>
15
16 <div class="gso__banner--edit">
17 <@liferay.language key="theme.banner.edit" />
18 </div>
19 <div class="checkButt" style="margin-top: calc(35vh);width: 200px;display: block;position:absolute;"></div>
20 <div class="gso__banner--content">
21
22 <#if VideoURL?? && VideoURL.getData()?has_content>
23
24 <video tabindex="-1" playsinline autoplay muted aria-hidden="true" loop preload="none"
25 poster="${phoneImagen.getData()}" style=" height: inherit; ">
26 <source src="${VideoURL.getData()}" type="video/mp4" />
27 </video>
28 </#if>
29 <#if youtubeUrl?? && youtubeUrl.getData()?has_content>
30 <iframe tabindex="-1" style="position: absolute;top: 50%;left: 50%;width: 100vw;height: 112vh;transform: translate(-50%, -50%);" class="embed-responsive-item" src="https://www.youtube.com/embed/${youtubeUrl.getData()}?controls=1&autoplay=1&mute=1&loop=1&showinfo=0&modestbranding=1&mute=1&playlist=${youtubeUrl.getData()}" frameborder="0" allowfullscreen aria-hidden="true"></iframe>
31
32 <video controls="true">
33 <source src="${youtubeUrl.getData()}" type="video/mp4" />
34 </video>
35 </#if>
36 </div>
37</a>
38</div>
39
40<script>
41function playpause(){
42 if($('.gso__banner video').get(0).paused){
43 $('.gso__banner video').get(0).play();
44 $('.gso__banner .play_pause i').removeClass('icon-play');
45 $('.gso__banner .play_pause i').addClass('icon-pause');
46 $('.gso__banner .play_pause').attr("aria-label",Liferay.Language.get('playpause.stop'));
47 $('.gso__banner .play_pause').attr("title",Liferay.Language.get('playpause.stop'));
48
49 } else{
50 $('.gso__banner video').get(0).pause();
51 $('.gso__banner .play_pause i').removeClass('icon-pause');
52 $('.gso__banner .play_pause i').addClass('icon-play');
53 $('.gso__banner .play_pause').attr("aria-label",Liferay.Language.get('playpause.play'));
54 $('.gso__banner .play_pause').attr("title",Liferay.Language.get('playpause.play'));
55
56 }
57}
58
59function PosterResized(){
60 if(window.screen.width < 700){
61 $("video")[0].poster = '${phoneImagen.getData()}';
62 $("video")[0].style.height = "inherit";
63 }else{
64 $("video")[0].poster = '${webImagen.getData()}';
65 $("video")[0].style.height = "auto";
66 }
67}
68
69
70function playpauseYT(){
71 var YTVideo='https://www.youtube.com/embed/${youtubeUrl.getData()}?controls=0&autoplay=1&mute=1&loop=1&showinfo=0&modestbranding=1&mute=1&playlist=${youtubeUrl.getData()}';
72 if($('.gso__banner iframe').attr("src")==''){
73 $('.gso__banner iframe').attr("src",YTVideo);
74 $('.gso__banner .play_pause i').removeClass('icon-play');
75 $('.gso__banner .play_pause i').addClass('icon-pause');
76 $('.gso__banner .play_pause').attr("aria-label",Liferay.Language.get('playpause.stop'));
77 $('.gso__banner .play_pause').attr("title",Liferay.Language.get('playpause.stop'));
78
79 } else{
80 $('.gso__banner iframe').attr("src","");
81 $('.gso__banner .play_pause i').removeClass('icon-pause');
82 $('.gso__banner .play_pause i').addClass('icon-play');
83 $('.gso__banner .play_pause').attr("aria-label",Liferay.Language.get('playpause.play'));
84 $('.gso__banner .play_pause').attr("title",Liferay.Language.get('playpause.play'));
85
86 }
87}
88
89$(document).ready(function(){
90 $('.gso__banner video').on('ended',function(){
91 $('.gso__banner .play_pause i').removeClass('icon-pause');
92 $('.gso__banner .play_pause i').addClass('icon-play');
93 $('.gso__banner .play_pause').attr("aria-label",Liferay.Language.get('playpause.play'));
94 $('.gso__banner .play_pause').attr("title",Liferay.Language.get('playpause.play'));
95
96 });
97
98 PosterResized();
99
100 $(window).resize(function() {
101 PosterResized();
102 });
103 });
104</script>