JW-Player use video thumbnail as featured image - youtube

If I upload external media (in particular a Youtube video) for use with the jw-player wordpress plugin... how do i use the thumbnail as my featured image ... so i can show thumbs in say the excerpts that link to the post where the full video is available.
the jw-player plugin seems to save the youtube screenshot as meta data, but the meta data is
associated with the attachment page and not w/ the post i am adding to my blog.

If that is the case, you can use <?php wp_get_attachment_metadata( $post_id, $unfiltered ) ?>. You'll need to look through the returned array to find that image and display it.
http://codex.wordpress.org/Function_Reference/wp_get_attachment_metadata

Related

Generating download link for youtube video with PHP but filename always saving as videoplayback.mp4

I'm tyrying to create a youtube video downloader script for education purpose. Everything is working fine and link generating but the problem is. it is alway's saving the video as videoplayback.mp4 , But i want to save video as the title of youtube video. How can i do that any idea or knowledge will you share with me please ? Thanks in Advance :)
Currently this kind of link generating with my script:
https://r5---sn-ax8xaj5ggpxg-q5je.googlevideo.com/videoplayback?ipbits=0&signature=962BE0E0565BE4A1C47228B9915BCB8F1CFEB960.9F6BB2DB759AEA92819A21B1D7169934E2029F12&key=yt6&itag=18&ratebypass=yes&expire=1493475511&dur=866.382&pl=24&gir=yes&pcm2=yes&sparams=clen,dur,ei,gir,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pcm2,pl,ratebypass,requiressl,source,upn,expire&beids=[9466594]&ip=103.250.70.10&lmt=1404765005406941&upn=3jfn7T_trrk&id=o-AIgDAd5Kx005dV22eO8I0kxdhqnMlelHM82MUR6361GG&ei=V0wEWdomgd6jA_7BiQg&initcwndbps=1491250&mn=sn-ax8xaj5ggpxg-q5je&mm=31&requiressl=yes&clen=17929313&mime=video/mp4&source=youtube&ms=au&mv=m&mt=1493453844
I'm adding title with this but it's not downloading video with the title
If you are using PHP to do all your work, then you can rename the file.
You should have the api request info for the video, such as name, id and such. So save the name in a variable and use it to rename the video.
Some basic info HERE to start from.
But you can find plenty of examples around renaming on Stackoverflow
You may user title tag at last of the your url. simply like:
https://r1---sn-npoe7ne6.googlevideo.com/videoplayback?c=xxxxxx&title=THIS+ONE+THING+COMPLETES+YOUR+ENTIRE+SALAH
Example: https://r1---sn-npoe7ne6.googlevideo.com/videoplayback?c=WEB&ei=PbcrXNPYN8j8DbS3g6gJ&signature=7158A95D1D19CE23E5927C5BA269FB93416BE9C3.3013C04B8A60583BE3976207ECC46104DA6231C5&ratebypass=yes&dur=78.135&itag=22&lmt=1546275183213302&key=cms1&expire=1546390430&beids=9466587&sparams=dur,ei,expire,id,ip,ipbits,itag,lmt,mime,mip,mm,mn,ms,mv,pl,ratebypass,requiressl,source&ipbits=0&pl=24&mime=video/mp4&id=o-APHRf9RA8ZFNEcdOCNFsj9WVumGp7BSSD5X3KXyvg0yF&source=youtube&txp=5432432&requiressl=yes&ip=107.178.194.200&fvip=1&extension=mp4&mip=119.30.38.95&redirect_counter=1&cm2rm=sn-bg5hxxo2ivox-q5jz7e&fexp=9466587,23763603&req_id=1d7d8e10b833a3ee&cms_redirect=yes&mm=29&mn=sn-npoe7ne6&ms=rdu&mt=1546368708&mv=m&title=THIS+ONE+THING+COMPLETES+YOUR+ENTIRE+SALAH
Now video will save with
THIS ONE THING COMPLETES YOUR ENTIRE SALAH.mp4
I think it will help you.

Youtube API: Revert video thumbnail to the default thumbnail

I am trying to revert the thumbnail of youtube videos, via the v3 API, to the thumbnail that is automatically generated by YouTube from a screenshot of the video when it's uploaded.
So, basically, I wanna delete the custom thumbnail I uploaded.
The documentation, as far as I can tell, only shows how to set a new thumbnail by uploading an Image, but has nothing on how to delete/revert thumbnails.
https://developers.google.com/youtube/v3/docs/thumbnails/set
Any pointers appreciated.
The only thing I can think of is that you grab one of the three automatically generated thumbnails:
http://img.youtube.com/vi/{video_id}/1.jpg
http://img.youtube.com/vi/{video_id}/2.jpg
http://img.youtube.com/vi/{video_id}/3.jpg
You could then upload either of them via the API. Unfortunately, they are in very poor quality. Maybe there is a way to get a high-quality version of them?
you can use this below url too, It gives you a good quality thumbnail
https://ytimg.googleusercontent.com/vi/{VIDEO_ID}/mqdefault.jpg
Actually You cannot get the other images at full size. Only /0.jpg or default image is large rest will be in thumbnail size.

YouTube API Search by Tags

I'm trying to add videos to an existing ASP.NET MVC site, and I'd like to show videos from our YouTube channel.
I have added a tag to each video to indicate what page it should appear on. I had thought that I could search our channel by tag on each page to render the relevant video on that page.
I'm trying to exclusively use the API v3, but it seems I can't do this.
I can't use developer tags, because videos are uploaded by multiple users using the standard YouTube front end. This seems like basic functionality, so I'm assuming it's my inexperience with this API.
As an example, our YouTube channel is ChillinWithCharlie. During development, one video is tagged 20141213Cheneys.
I can get all videos in our channel, but is there a way to query the v3 API to retrieve just this video?
I've seen one suggestion here that I retrieve all videos, and filter in code. This feels inefficient, so I'd rather not do this, but I can't even see where the tag is returned with all channel videos, that I could interrogate in code.
It's not just you. There seems to be no specific query parameter to search by tag with API v3.
I would recommend doing a search with your tag in the 'q' (search) parameter, then checking the results to see if the tag exists in the returned snippet->tags property to verify the exact video.
Note YouTube tags are only visible to the video's uploader.
https://developers.google.com/youtube/v3/docs/videos#snippet.tags[]

How to include images and videos in RSS

Do you know if it is possible to show images and videos in RSS? I've always shown text and links and i would like to know how can media be inserted in RSS feed.
I use ASPNET.MVC3
Just include markup like you would for a webpage. Here is an example feed from npr.org music that includes images and videos.
http://www.npr.org/rss/rss.php?id=15709577

How should I start this Ruby on Rails app?

I want to create an app in Ruby on Rails that when a user pastes the link of a video, the thumbnail is embedded, and when the user clicks the thumbnail, the video is embedded with ajax. How should I start developing this functionality? I plan on using Embedly. My first question is how do I use it? I've read the documentation, but there are a bunch of different tutorials and I'm not sure which one to use. And specifically how do I get the thumbnail and the video? Also, should I have a separate model for both the thumbnail and the video? Or should the thumbnail be a field in the video table? What should I be storing in my database?
I would really, really appreciate any help.
Embed.ly API gives you a pretty wide range of options. Thumbnail is also included in the return hash. All you need to do is capture the url your users paste, plug it into this API url, and parse the returned hash for the thumbnail image.
You can then easily use the jQuery plugin to generate the embed link when the user clicks on the thumbnail.
$.embedly('http://www.youtube.com/watch?v=LfamTmY5REw',
{maxWidth: 600,
elems: $('#element'),
success: function(oembed, dict){
alert(oembed.title);
});
Note that in this function elems property is where you want your video to be embedded. oembed parameter contains the hash, which includes the thumbnail image link. So you can do everything in this one call. Embed the video as soon as the user pastes the link, and simply hide the embedded video until the user interacts with the thumbnail image.
You should probably save the thumbnail url as a field of the same model as everything else.

Resources