oembed

Bind() to a dynamically embedded souncloud widget

丶灬走出姿态 提交于 2019-12-22 15:03:01
问题 I am using the following code to embed a soundcloud widget: SC.oEmbed(soundcloud_url, {color: "3C9FCE"}, document.getElementById('container_id')); How do I bind a SC.Widget.Events.Ready to it? I don't see any way to set the id or class of the embed iframe so that I can select it. Nor do I know when it has been loaded so that I can bind it, such as the following dysfunctional code: var frame = document.getElementById('container_id').getElementsByTag("iframe")[0]; frame.bind(SC.Widget.Events

How to dynamically embed the “tiny” version of the Soundcloud player using the JS SDK?

醉酒当歌 提交于 2019-12-22 12:12:58
问题 I'm building a website for a music composer. He'd like to publish samples of his work via Soundcloud and embed some of those samples on his website. He has a Premium account. I'd like to make this as easy as possible for him (he ain't no geek). Basically, I'd like to let him just copy & paste the song's URL from the browser's address bar and make my application do the rest for him. That's relatively easy to do actually - and I successfully made it work with the standard version of the player.

Filtering WordPress oEmbed provider list

前提是你 提交于 2019-12-11 11:16:38
问题 How would I filter the WordPress oEmbed provider list? My aim is to allow just Twitter and Youtube. EDIT: Could I do something like this? function filter_oembed_provider_list( $array ) { $array = array( 'http://youtu.be/*' => array( 'http://www.youtube.com/oembed', false ) ); return $array; } add_filter( 'oembed_providers', 'filter_oembed_provider_list' ); But this doesn't seem to work. Please see the relevant code in class-oembed.php: apply_filters( 'oembed_providers', array( '#https?://(www

WP Oembed not passing through the “autoplay=1” variable

纵然是瞬间 提交于 2019-12-11 01:39:03
问题 I'm having this problem. I am passing this through a custom field here (notice the "autoplay=1") But when I load the video on my theme using wp_oembed_get ... it displays the video fine, but it does not listen to the autoplay=1 variable I am passing through. I need the videos to play on the load of the page. 回答1: I think the way to do it is using wordpress filters: function modify_youtube_embed_url($html) { return str_replace("?feature=oembed", "?feature=oembed&autoplay=1", $html); } add

get youtube oembed json with ajax

◇◆丶佛笑我妖孽 提交于 2019-12-08 01:48:59
问题 I am try to get oembed code of youtube link with ajax but it returns always error I am using ajax with Jquery $.ajax({ method: 'GET', dataType :'json', url:'http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=wbp-3BJWsU8&format=json', success:function(data){ alert(data); }, error: function(error) { alert(error); } }); 回答1: try the following $.ajax({ url: 'http://query.yahooapis.com/v1/public/yql', data: { q: "select * from json where url ='http://www.youtube.com/oembed?url=http:/

How to correctly use oembed to pull thumbs from youtube

耗尽温柔 提交于 2019-12-07 12:00:54
问题 I show a lot of thumbs on my homepage from youtube videos. I was using this function below to grab the thumb from a youtube url which works fast but it doesn't work for url's in the shortned form like youtu.be/JSHDLSKL. function get_youtube_screen_link( $url = '', $type = 'default', $echo = true ) { if( empty( $url ) ) return false; if( !isset( $type ) ) $type = ''; $url = esc_url( $url ); preg_match("|[\\?&]v=([^&#]*)|",$url,$vid_id); if( !isset( $vid_id[1] ) ) return false; $img_server_num

How to use oembed tags to implement rich pins

不想你离开。 提交于 2019-12-07 01:58:53
问题 I need to implement rich pins provided by pinterest (http://developers.pinterest.com/rich_pins/). One of the recommended ways is to use oembed. Unfortunately I am not familiar with oembed tags and was wondering if somebody can provide more insight. What is the syntax for oembed tags? Should I surround with tags? Any particular place where it should be called? Any help will be appreciated. TIA 回答1: This gives examples, but given the SEO benefits of using structured data, it might be more

get youtube oembed json with ajax

空扰寡人 提交于 2019-12-06 12:37:21
I am try to get oembed code of youtube link with ajax but it returns always error I am using ajax with Jquery $.ajax({ method: 'GET', dataType :'json', url:'http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=wbp-3BJWsU8&format=json', success:function(data){ alert(data); }, error: function(error) { alert(error); } }); try the following $.ajax({ url: 'http://query.yahooapis.com/v1/public/yql', data: { q: "select * from json where url ='http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=wbp-3BJWsU8&format=json'", format: "json" }, dataType: "jsonp", success: function

Bind() to a dynamically embedded souncloud widget

老子叫甜甜 提交于 2019-12-06 07:18:57
I am using the following code to embed a soundcloud widget: SC.oEmbed(soundcloud_url, {color: "3C9FCE"}, document.getElementById('container_id')); How do I bind a SC.Widget.Events.Ready to it? I don't see any way to set the id or class of the embed iframe so that I can select it. Nor do I know when it has been loaded so that I can bind it, such as the following dysfunctional code: var frame = document.getElementById('container_id').getElementsByTag("iframe")[0]; frame.bind(SC.Widget.Events.Ready, listnerFucnt()); Thanks! If the reason you are using SoundCloud JavaScript SDK is to be able to SC

How to dynamically embed the “tiny” version of the Soundcloud player using the JS SDK?

醉酒当歌 提交于 2019-12-06 07:10:59
I'm building a website for a music composer. He'd like to publish samples of his work via Soundcloud and embed some of those samples on his website. He has a Premium account. I'd like to make this as easy as possible for him (he ain't no geek). Basically, I'd like to let him just copy & paste the song's URL from the browser's address bar and make my application do the rest for him. That's relatively easy to do actually - and I successfully made it work with the standard version of the player. But I can't find a working way of programmatically embeding the tiny version of the player. There's no