2012-09-01 11 views
6

Używam embedly, działa poprawnie, ale problem dotyczy niektórych filmów, które dają błąd- not a valid key. Wiem, że musimy zarejestrować się na ich stronie i zapłacić trochę za klucz, ale Nie chcę tego robić. Czy jest jakikolwiek inny sposób na uzyskanie kodu do osadzenia na filmie, tak, żebym mógł umieścić mój kod inaczej niż na embedly. Jeśli tak, pomóż mi w tym lub, jeśli to możliwe, podaj przykład, aby to zrobić. kod klucza podano poniżej.Jak uzyskać kod osadzony na wideo

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

Z góry dziękuję.

+0

http://oembed.com/ – hakre

Odpowiedz

1

Nie musisz płacić za zużycie pieniędzy.

Należy spróbować przewijanie w dół na stronie cenowej: http://embed.ly/pricing

Następnie wybierz opcję z wolnego.

1

Mam wbudowane kodowanie skryptu dla twojego problemu. Znajdź poniżej i używaj go zgodnie ze swoimi potrzebami.

<!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> 

Działa dobrze., Przetestuj go i użyj na życzenie.

+0

Dzięki @John Peter, ale jak już powiedziałem, nie dostaje wszystkich filmów, na przykład: http://www.wimp.com/puntreturn/. Nie wiem, dlaczego to nie działa, jeśli wiesz, czy możesz mi wyjaśnić? –

+0

Proszę odnieść się następującą lokalizację z powodu: http://embed.ly/docs/explore/oembed?url=icheb.wimp.com%2Floadvideo%2Fcd223b51d556b1e274b606b8dbd0c352%2F5055a5dd%2Fweb-videos%2F0cfb6bf8e8bbd5abe051661594e7c59f_photo.flv –

+0

więc jest tam Jakikolwiek sposób, aby uzyskać wideo z całej witryny, ponieważ zręcznie nie obsługuje wszystkich witryn wideo? Właściwie próbuję tego od 2 tygodni i nadal nie mam rozwiązania, proszę, pomóż mi w tym. –

Powiązane problemy