From efc0ca1d863980cee0a28827b05b088e18e1b267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Javier=20Moreno=20Hern=C3=A1ndez?= Date: Wed, 22 Apr 2020 17:18:57 +0200 Subject: [PATCH] [DEMAD] Correcciones correcciones conectados --- .../welcome/encuentrosconexpertos.html.erb | 63 +++++++++++-------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/app/views/welcome/encuentrosconexpertos.html.erb b/app/views/welcome/encuentrosconexpertos.html.erb index bcbbfa8ff8d..26e0f36765c 100644 --- a/app/views/welcome/encuentrosconexpertos.html.erb +++ b/app/views/welcome/encuentrosconexpertos.html.erb @@ -7,34 +7,45 @@ part : 'player,snippet', id : videoId, key: key_x}, - function(data) { + function(data) { $('#player').html("
"+data.items[0].player.embedHtml.replace("width=\"480\"", "").replace("height=\"270\"", "")+"
"); - if (data.items[0].snippet.liveBroadcastContent != 'none' ) { - $('#comments').html(""); + + if( navigator.userAgent.match(/Android/i) + || navigator.userAgent.match(/webOS/i) + || navigator.userAgent.match(/iPhone/i) + || navigator.userAgent.match(/iPad/i) + || navigator.userAgent.match(/iPod/i) + || navigator.userAgent.match(/BlackBerry/i) + || navigator.userAgent.match(/Windows Phone/i)) { + $('#comments').html("El chat no es accesible a través de una plataforma móvil"); } else { - $.get( - "https://www.googleapis.com/youtube/v3/commentThreads",{ - part : 'snippet', - order: 'time', - videoId : videoId, - maxResults: 6, - key: key_x}, - function(data) { - var contenido = ''; - if (data.items.length > 0) { - $.each( data.items, function( i, cont ) { - var item = cont.snippet.topLevelComment.snippet - var datecre = new Date(Date.parse(item.updatedAt)); - var fecha = datecre.getDay() + "/" + datecre.getMonth() + "/" + datecre.getFullYear(); - contenido = contenido + "

" + item.authorDisplayName + " - " + fecha + "

" + item.textDisplay + "

" - - }); - }else { - contenido = "No hay comentarios disponibles"; + if (data.items[0].snippet.liveBroadcastContent != 'none' ) { + $('#comments').html(""); + } else { + $.get( + "https://www.googleapis.com/youtube/v3/commentThreads",{ + part : 'snippet', + order: 'time', + videoId : videoId, + maxResults: 6, + key: key_x}, + function(data) { + var contenido = ''; + if (data.items.length > 0) { + $.each( data.items, function( i, cont ) { + var item = cont.snippet.topLevelComment.snippet + var datecre = new Date(Date.parse(item.updatedAt)); + var fecha = datecre.getDay() + "/" + datecre.getMonth() + "/" + datecre.getFullYear(); + contenido = contenido + "

" + item.authorDisplayName + " - " + fecha + "

" + item.textDisplay + "

" + + }); + }else { + contenido = "No hay comentarios disponibles"; + } + $('#comments').html(contenido); } - $('#comments').html(contenido); - } - ); + ); + } } } ); @@ -52,7 +63,7 @@ var item = cont.snippet var datecre = new Date(Date.parse(item.publishedAt)); var fecha = datecre.getDay() + "/" + datecre.getMonth() + "/" + datecre.getFullYear(); - contenido = contenido + "
" + contenido = contenido + "
" contenido = contenido + "
" contenido = contenido + "
" contenido = contenido + ""