2012-09-01 20 views
6

Estoy usando embedly, está funcionando correctamente pero el problema es que para algunos videos da error- not a valid key. Sé que tenemos que registrarnos en su sitio y pagar algo de dinero por la clave pero, No quiero hacer eso. ¿Hay alguna otra solución para obtener el código de inserción de un video para que yo pueda poner mi código que no sea de inserción? Si es así, por favor ayúdenme en esto o, si es posible, proporcione un ejemplo para hacer esto. el código para una clave se proporciona a continuación.Cómo obtener un código incrustado para video

$pro = new Embedly_API(array(
    'key' => 'xxxxxxxxxxxxxxxx', //need a pro key for this 
    'user_agent' => 'Mozilla/5.0 (compatible; mytestapp/1.0)' 
)); 

Gracias de antemano.

+0

http://oembed.com/ – hakre

Respuesta

1

Usted no necesita para pagar dinero por el uso de la luz.

Usted debe tratar de desplazarse hacia abajo en la página de precios: http://embed.ly/pricing

A continuación, seleccione la opción libre.

1

He creado la codificación para su secuencia de comandos para su problema., Encuentre la siguiente y haga uso de ella según sus necesidades.

<!DOCTYPE> 
<html> 
    <head> 
    <title>Page Title</title> 
    <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> 
    <script type="text/javascript"> 
     /* 
* Embedly JQuery v2.2.0 
* ============== 
* This library allows you to easily embed objects on any page. 
*/ 
(function(a){window.embedlyURLre=/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;a.embedly=a.embedly||{};if(a.embedly.version){return}a.extend({embedly:function(k,q,n){var c=[];var p="http://api.embed.ly/";var d;q=q?q:{};d=a.extend({},a.embedly.defaults,q);if(!d.urlRe){d.urlRe=window.embedlyURLre}if(typeof k==="string"){k=new Array(k)}if(typeof n!=="undefined"){d.success=n}if(d.secure){p="https://api.embed.ly/"}if(!d.success){d.success=function(i,t){var r,s=a(t.node);if(!(i)){return null}if((r=d.method)==="replace"){return s.replaceWith(i.code)}else{if(r==="after"){return s.after(i.code)}else{if(r==="afterParent"){return s.parent().after(i.code)}else{if(r==="replaceParent"){return s.parent().replaceWith(i.code)}}}}}}if(!d.error){d.error=function(i,r){}}var m=function(i){return d.urlRe.test(i)};var o=function(r){var i="urls="+r;if(d.maxWidth){i+="&maxwidth="+d.maxWidth}else{if(typeof dimensions!=="undefined"){i+="&maxwidth="+dimensions.width}}if(d.maxHeight){i+="&maxheight="+d.maxHeight}if(d.chars){i+="&chars="+d.chars}if(d.words){i+="&words="+d.words}if(d.secure){i+="&secure=true"}if(d.frame){i+="&frame=true"}i+="&wmode="+d.wmode;if(typeof d.autoplay==="string"||typeof d.autoplay==="boolean"){i+="&autoplay="+d.autoplay}if(d.width){i+="&width="+d.width}return i};var j=function(){if(typeof d.autoplay==="string"){if(d.endpoint.search(/objectify/i)>=0){return p+"2/objectify"}else{if(d.endpoint.search(/preview/i)>=0){return p+"1/preview"}}}return p+"1/oembed"};var b=function(){var i=[];if(d.addImageStyles){if(d.maxWidth){units=isNaN(parseInt(d.maxWidth,10))?"":"px";i.push("max-width: "+(d.maxWidth)+units)}if(d.maxHeight){units=isNaN(parseInt(d.maxHeight,10))?"":"px";i.push("max-height: "+(d.maxHeight)+units)}}return i.join(";")};var g=function(v,t){if(d.endpoint!=="oembed"){return d.success(v,t)}var w,s,r,y,u,i,x,z;if((w=v.type)==="photo"){y=v.title||"";s="<a href='"+t.url+"' target='_blank'><img style='"+b()+"' src='"+v.url+"' alt='"+y+"' /></a>"}else{if(w==="video"){s=v.html}else{if(w==="rich"){s=v.html}else{y=v.title||t.url;i=v.thumbnail_url?"<img src='"+v.thumbnail_url+"' class='thumb' style='"+b()+"'/>":"";z=v.description?'<div class="description">'+v.description+"</div>":"";x=v.provider_name?"<a href='"+v.provider_url+"' class='provider'>"+v.provider_name+"</a>":"";s=i+"<a href='"+t.url+"'>"+y+"</a>";s+=x;s+=z}}}if(d.wrapElement&&d.wrapElement==="div"&&a.browser.msie&&a.browser.version<9){d.wrapElement="span"}if(d.wrapElement){s="<"+d.wrapElement+' class="'+d.className+'">'+s+"</"+d.wrapElement+">"}v.code=s;if(typeof t.node!=="undefined"){a(t.node).data("oembed",v).trigger("embedly-oembed",[v])}return d.success(v,t)};var e=function(i){var t,v,u,s,r;u=a.map(i,function(x,w){if(w===0){if(x.node!==null){r=a(x.node);s={width:r.parent().width(),height:r.parent().height()}}}return encodeURIComponent(x.url)}).join(",");a.ajax({url:j(),dataType:"jsonp",data:o(u),success:function(w){return a.each(w,function(x,y){return y.type!=="error"?g(y,i[x]):d.error(i[x].node,y)})}})};a.each(k,function(s,r){var u=typeof d.elems!=="undefined"?d.elems[s]:null;if(typeof u!=="undefined"&&!m(r)){a(u).data("oembed",false)}var t={url:r,error_code:400,error_message:"HTTP 400: Bad Request",type:"error"};return(r&&m(r))?c.push({url:r,node:u}):d.error(u,t)});var l=[];var h=c.length;for(var f=0;(0<=h?f<h:f>h);f+=20){l=l.concat(e(c.slice(f,f+20)))}if(d.elems){return d.elems}else{return this}}});a.embedly.version="2.2.0";a.embedly.defaults={endpoint:"oembed",secure:false,frame:false,wmode:"opaque",method:"replace",addImageStyles:true,wrapElement:"div",className:"embed",elems:[]};a.fn.embedly=function(d,g){var e=typeof d!=="undefined"?d:{};if(typeof g!=="undefined"){d.success=g}var f=new Array();var c=new Array();this.each(function(){if(typeof a(this).attr("href")!=="undefined"){f.push(a(this).attr("href"));c.push(a(this))}else{a(this).find("a").each(function(){f.push(a(this).attr("href"));c.push(a(this))})}e.elems=c});var b=a.embedly(f,e);return this}})(jQuery); 

     </script> 
    <script type="text/javascript"> 
     $('document').ready(function(){ 
     $('div.content').embedly({ 
      maxWidth: 450, 
      wmode: 'transparent', 
      method: 'after'  
     }); 
     }); 
    </script> 
    </head> 
    <body> 
    <div class="content"> 
     <article> 
     <h2>Title</h2> 
     <p>Lorizzle ma nizzle dolor sit amizzle, brizzle adipiscing elit. </p> 
     <a href="http://www.youtube.com/watch?v=ZbcgyPtYBY0">youtube</a> 
     <p>Maecenizzle owned bow wow wow. Nam eros.</p> 
     </article> 
     <article> 
     <h2>Title 2</h2> 
     <p>Lorizzle ma nizzle dolor sit amizzle, brizzle adipiscing elit. </p> 
     <a href="http://www.flickr.com/photos/churchclothing/2597225382/">flickr</a> 
     <p>Maecenizzle owned bow wow wow. Nam eros.</p> 
     </article> 
    </div> 
    </body> 
</html> 

Está funcionando bien. Pruébelo y úselo como desee.

+0

Gracias a John Peter, pero como he dicho, no está recibiendo todo el video, por ejemplo: http://www.wimp.com/puntreturn/. No sé por qué esto no funciona, si sabes ¿puedes explicarme? –

+0

Consulte la siguiente ubicación por la razón: http://embed.ly/docs/explore/oembed?url=icheb.wimp.com%2Floadvideo%2Fcd223b51d556b1e274b606b8dbd0c352%2F5055a5dd%2Fweb-videos%2F0cfb6bf8e8bbd5abe051661594e7c59f_photo.flv –

+0

Entonces, ¿hay ¿Hay alguna forma de obtener el video de todo el sitio porque embeldly no admite todo el sitio de videos? En realidad estoy intentando esto desde hace 2 semanas y todavía no hay solución, por favor ayúdenme en esto. –

Cuestiones relacionadas