admin管理员组文章数量:1335609
I have checked and read lot of post about one single issue that is far more complicated than it seems.
I have a website that uses a lot of videos taken from wwebsite as on the internet ^^ (services like youtube, vimeo, videobuzzy, etc) and we would like to generate on the fly a thumbnail of the embedded video.
Each service uses its own API so I should adapt code for each, which it far too much code and I could never manage every service.
A webserver propose something like that : but I tried them and, as exemple, videos from videobuzzy doesn't work. So that's a partial solution.
Another solution would be to use a screenshot service that could request the video's URL, render it, take a snapshot and generate an image. Tempting, but results tends to add delays, and I have to find a snapshot service and generate the code (well, this could be the fun part).
The simpliest would be to take a screen capture and create an image ourselves, then upload it.
I would rather propose something more user-friendly but I have no more clue.
Is anyone has some advice on it and do I get the picture right ?
Thank you.
ADDENDUM **
If I could, instead of the thumbnails, just embed the video (usually an iframe) into a with specific size, that could do the trick...
I have checked and read lot of post about one single issue that is far more complicated than it seems.
I have a website that uses a lot of videos taken from wwebsite as on the internet ^^ (services like youtube, vimeo, videobuzzy, etc) and we would like to generate on the fly a thumbnail of the embedded video.
Each service uses its own API so I should adapt code for each, which it far too much code and I could never manage every service.
A webserver propose something like that : http://embed.ly but I tried them and, as exemple, videos from videobuzzy doesn't work. So that's a partial solution.
Another solution would be to use a screenshot service that could request the video's URL, render it, take a snapshot and generate an image. Tempting, but results tends to add delays, and I have to find a snapshot service and generate the code (well, this could be the fun part).
The simpliest would be to take a screen capture and create an image ourselves, then upload it.
I would rather propose something more user-friendly but I have no more clue.
Is anyone has some advice on it and do I get the picture right ?
Thank you.
ADDENDUM **
If I could, instead of the thumbnails, just embed the video (usually an iframe) into a with specific size, that could do the trick...
Share Improve this question edited Feb 1, 2012 at 9:43 Simon asked Feb 1, 2012 at 9:31 SimonSimon 1,2181 gold badge12 silver badges22 bronze badges 1- One way found was via a plugin: wordtube. Generally covering JW Player.. but maybe useful. – majicmike Commented Sep 18, 2012 at 19:31
2 Answers
Reset to default 22You 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/oembed
- http://blip.tv/oembed/
- http://vimeo/api/oembed.xml
- http://www.dailymotion/api/oembed/
- http://www.flickr/services/oembed/
- http://api.smugmug/services/oembed/
- http://www.hulu/api/oembed.xml
- http://lab.viddler/services/oembed/
- http://qik/api/oembed.xml
- http://revision3/api/oembed/
- http://photobucket/oembed
- http://photobucket/oembed
- http://www.scribd/services/oembed
- http://wordpress.tv/oembed/
- http://polldaddy/oembed/
- http://www.funnyordie/oembed
The full list of possible providers is documented at the WordPress codex under:
Embeds - Okay, So What Sites Can I Embed From?
Select your provider then use the following to get your video information.
require_once(ABSPATH.'wp-includes/class-oembed.php');
$oembed= new WP_oEmbed;
$url = 'http://www.youtube/watch?v=oHg5SJYRHA0';
//As noted in the comments below, you can auto-detect the video provider with the following
$provider = $oembed->discover($url);
//$provider = 'http://www.youtube/oembed';
$video = $oembed->fetch($provider, $url, array('width' => 300, 'height' => 175));
$title = $video->title;
$html = $video->html;
$thumb = $video->thumbnail_url;
I realize VideoBuzzy is not on the list. It appears to be a YouTube knockoff site. You should ask them if they have oembed protocols. If they don't, you can register a non oembed handler by using wp_embed_register_handler()
.
Hope this helps!
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.
本文标签: Generating Thumbnails for video
版权声明:本文标题:Generating Thumbnails for video 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742392652a2466294.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论