Create a video preview from link paste - php

Is there a script that simulates facebook's video post? where you can paste the link in your post, and it will automatically bring up a preview and description of the video? Or is this simple enough to do without a script? How would I go about this?

When you paste the link you will need to parse the link to retrieve the video ID.
Once you have the ID you can get the video information from the Facebook Graph.
This should give you an example of the data available: https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Dvideos

Related

Embed soundcloud player with url

i'm actually working on a website where the users will put the soundcloud link of their tracks and there will be a player directly on the website. The problem is I have not found any solution on how to embed a soundcloud player with only the link. I can't ask my users to give me the iframe link it would not be serious i guess.
So thanks to everyone in advance !
I can't ask my users to give me the iframe link. You can change an iframe src with javascript. Just give the iframe an id. Then compose the link using js and insert the user's part into the string to be assigned to src.

How to extract Youtube thumbnail from Textarea on post just like Facebook

have tried searching the solution to this question here but couldn't find the exact solution to my problem. what i want to do is to display the thumbnail of youtube video link posted in the textarea field of my website without having a separate input field for video urls just like its done on facebook where you post a youtube link to the same status box and it shows the thumbnail of the video.
Thanks alot

PHP & post Youtube ID to another page

I've been searching for this a lot but have not found exactly what I'm looking for.
So, I have a page (index.php) which displays my YouTube channel's uploaded videos as thumbnails, and either displays them inline above the thumbnails, or as links that redirect to Youtube. What I'd like to do, is to get the video's ID (which is in the a href link) and post it to another page (video.php) that shows the full embedded video (of the ID in question), with title & description. Is this possible to do?
My site is loosely based on this: http://www.yvoschaap.com/youtube.html and I've tried Youmax, but like said, they only play videos inline. I want to pass the ID of a clicked video as a parameter to the video.php page.
Sorry if this is confusing, but I'm still quite new to programming :)
You can look into Youtube Data API.
The main link you will need to retreive a list of all Videos for a channel will be somewhat like:
https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults={number_of_videos_you_want}
It will recieve it's response in JSON Format containing information like your Video ID which you can pass as Parameter to your video.php page

Why Facebook preview image is not showing up?

I have developed news page in my site and my client want to post the news from my site to
facebook and when he paste news link on the facebook, ideally it should create a facebook
post preview which load snapshot of news and also it populates image [if that page contains any image] in that snapshot.
I have searched on google and I found that I need use https://developers.facebook.com/tools/debug/ and I have used that facebook tool and I found that image is not grabbed while creating snapshot.
Now please someone tell me that what I can do to get image in preview of fb post.
Here is link which is having image in his content but still is not visible in preview.
this link is having image but when I this link on fb, it is not showing up image.
As news are get created automatically, I can add any meta tag because its static solution but I am using news feed which automatically creates new pages.
So I am not expecting any static solution
The reason you are not able to see an image preview is because there is no open graph object specified on that page. For example, you need to add this :
<meta property="og:image" content="http://bevforce.com/sites/default/files/2014-07-31%2003.59.57.jpg"> in your header.
More information about open graph object on Facebook documentation.

Facebook does not show thumbnail when a photo is shared

I am using the following code to share images on facebook but when the dialog box is shown it does not show the image and once it is uploaded facebook just shows a link to image.
<a name="share" type="button" href="https://www.facebook.com/sharer.php?u=www.example.com/myimage" target="_blank">share</a>
This should work like this
<a href="http://www.facebook.com/sharer.php?s=100&p[title]=Our Site Title&p[url]=http://us.oursite.com/default.aspx&p[images][0]=http://www.history.malc.eu/globe.jpg&p[summary]=Our facebook description that is used on the FB share page." target="_blank">
Share this
</a>
EXAMPLE
Use the Facebook debug tool to see how Facebook processes the URL you're sharing.
The Facebook scraper will look for OpenGraph meta tags. You can reference the image you want as a thumbnail with the og:image and og:image:secure_url
Alternatively, if you wanted to upload the image to Facebook so that it goes into the user's album, you should check out How-To: Use the Graph API to Upload Photos to a User's Profile
To be more clear, you should not be sharing a link directly to the image, but rather to a page which has OpenGraph meta tags, one of which should link to the image.
Facebook doesn't support sharing of plain images, only hyperlinks can be shared. Try posting the same image's link on your profile as status. Facebook won't show you any thumbnail for it but just the link. To share a image on facebook, you have to somehow upload it -_-
From the social plugins docs the share initiates a callback from Facebook to the page you want to share. To affect what that shows you would have a page with meta tags (og:image, og:title and og:description) to affect what Facebook puts in the comment on the users timeline.
To show the image, you'd probably need a hosting 'page' that uses a thumbnail of your image in its meta data so that it appears in the users timeline correctly.
Facebook then polls this periodically. This is very similar to the like mechanism.
Make sure you use dont click on share more than once, after that you cant see additional changed you made for next 24 hours

Categories