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 http://blip.tv/...


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 WP_Embed->...


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

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


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: http://stackoverflow.com/questions/7386675/video-capture-...


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

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


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

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

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

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

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

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 src="your/url"...


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

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

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


3

Registering a custom embed handler Here's an example how we can use the wp_embed_register_handler() function in your case: /** * Register an embed handler for myvi videos */ add_action( 'init', function() { wp_embed_register_handler( 'myvi', '#http://www\.myvi\.ru/watch/([a-zA-Z0-9_-]+)$#i', // <-- Adjust this to your needs! ...


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 isn'...


2

Are you planning on converting the videos to .flv yourself? If not I would go with youtube/vimeo etc, it's easy to upload a video, get the embed code and job done. If you have internal hosting (or better still a server and someone to manage it on the university network) then http://videopress.com/ might be worth a look.


2

Hi @Jonathan Sampson: @EAMann is spot-on, Custom Post Types are the way to go. Here's code you can toss in your theme's functions.php file to implement the Custom Post Type you need (note I included a helper function make_post_type_labels() I like to use that reduces the complexity of defining Custom Post Types): register_post_type('daily-video', array( ...


2

I'd recommend using a custom post type to handle this. You can add the custom post type and set it to only accept the YouTube url as content. Then you can display the "most recent" post from this setup with a custom loop on your home page. Here are a couple other good resources to start with: Description of custom post types Great tutorial


2

Indeed, the "Insert video" action does not do much beyond creating a link. WordPress does not contain a generic player that can play any video hosted anywhere on the internet, but it does support something better: embedding via oEmbed. This means you can put the URL of the video page in your content, and it will replace it with the proper embed code - if the ...


2

This is how I retrieve video (or any non-image) meta data. // assuming you have an attachment ID $meta = wp_get_attachment_metadata( $attachment->ID ); // See what meta data is available print_r( $meta ); // always check for the property's existence before trying to display it if ( ! empty( $meta['width'] ) ) echo $meta['width']; You can echo any ...


2

The best solution here is to use the built-in filter for embed parameters: <?php function mytheme_embed_defaults( $defaults ) { return array( 'width' => 100, 'height' => 100 ); } add_filter( 'embed_defaults', 'mytheme_embed_defaults' ); ?> This code can be added to your theme's functions.php file and you can change the numbers ...



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