Ir para conteúdo
Fórum Script Brasil

Rogers

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Sobre Rogers

Rogers's Achievements

0

Reputação

  1. Olá Tudo bom? estava navegando pela internet quando achei um supertemplate de video, estava muito bom, porém(sempre tem isso), me deparei que para postar um video novo o template só aceita videos do Youtube --' e o sistema é desenvolvido em Javascript por que é feito para o Blogger. então gostaria da ajuda de vocês para reverter os videos do Youtube para megaupload. Obs: O template foi feito no para Blogger ou seja usa XML + Javascript. Fui até o código fonte do template e achei a parte onde fala do youtube. &lt;script type='text/javascript'><!--//--><![CDATA[//><!-- var thumbnail_mode = 'float'; summary_noimg = 50; summary_img = 50; img_thumb_height = 120; img_thumb_width = 192; function createVideoThumb(pID){ var div = document.getElementById(pID); var summ = summary_noimg; if (div.innerHTML.indexOf("http://www.youtube.com/watch?v=")!=-1){ var vidid = div.innerHTML.substring(div.innerHTML.indexOf("http://www.youtube.com/watch?v=")+31,div.innerHTML.indexOf("endofvid")); }else {var vidid =""}; var postlink = div.innerHTML.substring(div.innerHTML.indexOf("[postlink]")+10,div.innerHTML.indexOf("[/postlink]")); if (vidid ==""){var imgvid ='<a href="'+ postlink + '"><img class="thumbnail" src="http://4.bp.blogspot.com/_WoCJXgXotb8/Srr309bkf_I/AAAAAAAAAB8/r9HXg7EGLYI/s1600/novideo.png" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></a>'; }else{ var imgvid ='<a href="'+ postlink + '"><img class=thumbnail src="http://i2.ytimg.com/vi/'+vidid+'/default.jpg" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></a>'; }; var summary = imgvid; div.innerHTML = summary; } function createVideoThumb2(pID){ var div = document.getElementById(pID); var imgtag = ""; var summ = summary_noimg; if (div.innerHTML.indexOf("http://www.youtube.com/watch?v=")!=-1){ var vidid = div.innerHTML.substring(div.innerHTML.indexOf("http://www.youtube.com/watch?v=")+31,div.innerHTML.indexOf("endofvid")); }else {var vidid =""}; var textinside = div.innerHTML.substring(div.innerHTML.indexOf("[starttext]")+11,div.innerHTML.indexOf("[endtext]")); var postlink = div.innerHTML.substring(div.innerHTML.indexOf("[postlink]")+10,div.innerHTML.indexOf("[/postlink]")); var embedvid = ""; if (vidid!="") { embedvid = '<object width="654" height="393"><param name="movie" value="http://www.youtube.com/v/'+ vidid + '&hl=en&fs=1&rel=0&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+ vidid + '&hl=en&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="654" height="393"></embed></object>' } var summary = embedvid + '<div class="content">' + textinside + '</div>'; div.innerHTML = summary; } //--><!]]></script> Está é a parte que fala sobre o youtube no template já tentei modificar os valores que mostrão youtube pelos do megavideo porém na hora de executar o video até aparece o video nas postagens porém na hora de ver aparece uma mensagem de erro do megavideo dizendo que o video não existe. Este codigo é o corpo onde fica os posts ficam alinhados em lista. function showgalleryvideo(json) { var showpostthumbnails_vid = true; var showpostsummary_vid = true; document.write('<ul>'); for (var i = 0; i < numposts_vid; i++) { var entry_vid = json.feed.entry[i]; var posttitle_vid = entry_vid.title.$t; var posturl_vid;if (i == json.feed.entry.length) break; for (var k = 0; k < entry_vid.link.length;k++){ if (entry_vid.link[k].rel == 'alternate') { posturl_vid = entry_vid.link[k].href;break; } } if("content"in entry_vid){ var postcontent_vid=entry_vid.content.$t; } var vidid_vid = postcontent_vid.substring(postcontent_vid.indexOf("http://www.youtube.com/watch?v=")+31,postcontent_vid.indexOf("endofvid")); try {thumburl_vid='http://i2.ytimg.com/vi/'+vidid_vid+'/0.jpg';}catch (error){ thumburl_vid='http://1.bp.blogspot.com/_u4gySN2ZgqE/SmWGbEU9sgI/AAAAAAAAAhc/1C_WxeHhfoA/s800/noimagethumb.png'; } document.write('<li><div id="slide-container"><span class="slide-desc"><h2 style="margin:10px 0px;">'); document.write(posttitle_vid+'</h2>'); var textinside_vid = postcontent_vid.substring(postcontent_vid.indexOf("[starttext]")+11,postcontent_vid.indexOf("[endtext]")); var re = /<\S[^>]*>/g; postcontent_vid = textinside_vid.replace(re, ""); if (showpostsummary_vid == true) { if (postcontent_vid.length < numchars_vid) { document.write(postcontent_vid); document.write('</span>');} else { postcontent_vid = postcontent_vid.substring(0, numchars_vid); var quoteEnd_vid = postcontent_vid.lastIndexOf(" "); postcontent_vid = postcontent_vid.substring(0,quoteEnd_vid); document.write(postcontent_vid + '...'); document.write('</span>');} } document.write('<a href="'+ posturl_vid + '"><img src="'+thumburl_vid+'"/></a></div>'); document.write('</li>'); }document.write('</ul>'); } Para postar um novo video é necessário quando for postar colocar este código na postagem. COLOQUE O CODIGO DO YOUTUBE AQUI endofvid [starttext] DESCRIÇÃO DO VIDEO [endtext] Mas acho que não tem muita alteração, na minha opnião o erro está na hora de pegar o id do video, mas já que não sou tão chegado a javascript peço a ajuda de vocês obrigado = D
×
×
  • Criar Novo...