Hot answers tagged

17

You can use the oEmbed functionality baked into WordPress. Typically any video host on this list will return a thumbnail to you using oembed. Here is a list of default providers that WordPress uses for auto embedding in the content area. I've included non-video sources as well for the convenience of others. http://www.youtube.com/oembed ...


14

Not natively. You'd have to write some code to make it happen - there's a nice pastebin function that provide the necessary code to do it. Edit (12/19/2011): Yep here's how you can do this programmatically. Add the following two functions to your functions.php file and you should be good to go. The code has been commented to explain what's happening, but ...


8

Simply put [embed] is not a regular shortcode. Most of the time it does nothing. What happens when post content goes through the_content filter is following: [emded] is currently registered to do nothing ( __return_false() ) WP_Embed->run_shortcode() filter runs with low 8 priority all shortcodes are disabled [embed] is registered to ...


5

_e() echoes the translated string, which will not work in variable assignment. You need to use __(), which returns the translated string.


5

You can use the get_media_embedded_in_content() function for both shortcode and embedded media (it looks for these HTML tags: audio, video, object, embed, or iframe), just be sure to use content with applied filters and shortcode executed. For example: $post_id = 125; $post = get_post($post_id); //Get the content, apply filters and execute shortcodes ...


4

This is overview how you can make it working: First with below code you can detect youtube URL for details Please read: $reg = preg_match('|^\s*(https?://[^\s"]+)\s*$|im', $post_id_63->post_content, $matches); if (!$reg) return false; $url = trim($matches[0]); // youtube video url echo wp_oembed_get($url); // this will return youtube vidoe ...


4

Notes before What you're asking for is a highly complex thing: Load next post after WP internal Data finished, played with some 3rd party player Load next post after YouTube player (javascript or ActionScript) finished The problem is not the redirect 1), but more how you want to know how & when to load the next post. 1) Which in fact(/imho) should ...


4

I'm from the team that developes BuddyPress Media. Till now, capturing a video involved expensive (in various ways) setups. It depended on flash and silverlight which could reach the hardware (mic and webcam) . Html5 is the way to go, now. However, the support isn't wide enough. This might help you: ...


4

You can filter the HTML output for oEmbed with oembed_result. Now test the HTTP host of the URL for www.youtube.com and add the parameter. The oEmbed result is cached in a post meta field to avoid too many requests. To update old posts I have added an activation helper that clears those cached content for Youtube embeds only. <?php # -*- coding: utf-8 ...


4

I just finished a Wordperss site that had a similar need for playing video. I would recommend going the Youtube route. Youtube will handle hosting, file conversions and with iframe embedding you can be sure the most devices possible will see your videos. On the Wordpress side of the equation, there are many helpful plugins that work with Youtube. My ...


3

The problem with this is that each sites content is formated differently. If there was only one site you were wanting to pull from you maybe able to use curl() and then sort though the content. A better idea may be to grab content from the sites RSS feed and sort though and grab what you need. You could probably write a quick plugin that would either ...


3

ntechi, To answer your question in the comment above ("is it possible i take it from google? for example in google images if i type "Apple" then i get images of apple, but in such a way, that this apple wont be typed in google but into my dashboard, and it will go to google and display it on my blog is this possible?") The answer is more than likely "no". ...


3

You can use the Blip TV API: http://wiki.blip.tv/index.php/Blip.tv_API Look for "How do I find the thumbnail for an item?" Examples of the API can be found in the wiki e.g. the PHP Example: include_once("blipPHP.php"); $blipPHP = new blipPHP("username", "password"); $respond = $blipPHP->info(4794325); returns a LONG array. Inside this you find: [3] ...


3

You need a media player. WordPress (and more importantly your server) doesn't know how to play media unless you've got it in via HTML5. You can use plugins like Viper's Video Quicktags which can parse it for you.


3

wp-includes/class-oembed.php has a public variable $providers. So you can build a small function to get all of them: function list_oembed_providers( $print = TRUE ) { require_once( ABSPATH . WPINC . '/class-oembed.php' ); $oembed = _wp_oembed_get_object(); $print and print '<pre>' . htmlspecialchars( var_export( $oembed->providers, ...


3

You can't just put a play button over an image and expect it to play a video without some serious magic. What you can do easily is change the video oembed size depending on what the viewer is looking at, for example for the front loop you can have a very tiny (thumbnail size) video that plays, and if they click through to the post they get larger size. You ...


3

filtering the_excerpt() If you remove_filter( 'get_the_excerpt', 'wp_trim_excerpt' ) and add your own get_the_excerpt filter you can do this. The default filter (wp_trim_excerpt()) can be found on line 2023 of /wp-includes/formatting.php if you want to just modify that. The extent of what you need to do is just modifying which tags are allowed in ...


3

No, that is not possible. You can use oEmbed for some video sources, but for your own video you have to decide what a player you want to use. That’s exactly what plugins are for. There is no point in avoiding using them. Update In WordPress 3.6 support for native audio and video was added. Use the shortcodes [audio src="your/url"] and [video ...


3

You can use this plugin Wordpress Video Plugin and edit the code of this plugin and add the other sites in it. OR You have to integrate FFMPEG in wordpress.


3

The plugin uses cURl direkt instead of WordPress' built in HTTP class. If your sever does not support cURL, the plugin can not work and you got this message. Deinstall the plugin and use another one. Or replace the curl_it() function within the plugin with something stable. Update The workaraound: Open the plugin file youtube-sidebar-widget.php and ...


3

Aha! WordPress has a built in function for it :D <?php echo $embed_code = wp_oembed_get( $video ); ?> Simples.


3

Well... To embed a video or another object into a post or page, place its URL into the content area. Make sure the URL is on its own line and not hyperlinked (clickable when viewing the post). https://codex.wordpress.org/Embeds#What_About_oEmbed_Discovery.3F So, to "disable" embedding the simplest thing is to make sure the URL ...


3

Take out the var_dump. That is debugging code, it's dumping the variable so that you can see what it is. Edit: Okay, I think you're asking the wrong question here, as did the other person in the question that you linked to. Adding additional query args onto the URL being sent to wp_ombed_url() won't cause the oembed system to send them on to the oembed ...


2

The WebM file format isn't known to WordPress by default, you have to add it. add_filter( 'upload_mimes', 'custom_mimes' ); function custom_mimes( $mimes ){ $mimes['webm'] = 'video/webm'; return $mimes; } The .ogg file format is known to WordPress as audio/ogg, if you're wanting to do video with it, the correct extension is .ogv.


2

Assuming your content is in the variable $content you would begin by removing all html tags using wp_strip_all_tags: $new_content = wp_strip_all_tags( $content ); Then you will want to trim that to 200 characters using substr: $new_content = substr( $new_content, 0, 200 ); To retrieve the YouTube video, you'll need to use preg_match: preg_match( ...


2

I remember when TED videos first brought me here to WPSE some time ago :-) The global content width or the embed size width option embed_size_w might be slightly off on your site. Alternatively you could manually insert the width: [ted id="2252" width="600"] where the height is then adjusted to give you the 16x9 aspect ratio. Note that TED oEmbed ...


2

Okay the thing is that the oembed endpoint seems not to support any other than the default parameters. So it seems that all you can do is parse the response and add in your parameters to the iframe src. This should do it (untested) function wpse_218836_add_youtube_parameter( $return, $data, $url ){ if ( $data->provider_name === 'YouTube'){ ...


2

I remember a similar issue for the audio shortcode here. There I found a workaround by allowing the empty audio extension. You could try something similar with the video extensions. Here's a demo plugin: <?php /** * Plugin Name: GET Parameters In The Video Shortcode * Description: Allow video files with GET parameters in the video shortcode ...


2

You got two options. Either you filter your valid video extentions as @birgire recommended. I remember a similar issue for the audio shortcode here. There I found a workaround by allowing the empty audio extension. You could try something similar with the video extensions. Here's a demo plugin: /** * Allow the empty video extension to ...


2

I'm assuming you already know how to get your popup video working, and you want to know how to make sure only people who aren't logged in see the video. You can add this to your template file (footer.php is probably best): <?php if (is_front_page() && !is_user_logged_in()) { //video popup content } ?> WP: is_user_logged_in() » ...



Only top voted, non community-wiki answers of a minimum length are eligible