facebook links getting info from websites - javascript

hi i was wondering how facebook turns their links into information from the sites before and after posting.
and also, how do they get a thumbnail image from the youtube videos? After all this , is it possible to just append the embedded youtube code to the page and start the movie by using youtubes api?

For getting youtube video embed code and thumbnail take a look at http://www.oembed.com/

They have their servers request the URI mentioned by the user. It is HTML, and thus easy to find images in the source.
Using YouTube's API would be a logical approach to solving that problem.

Related

I would like to create a music website like mp3 juice/mp3 paw

I want to to create a website that fetch data from YouTube when you search from it in away that any data uploaded to YouTube you can search it in that webapp and find it be available for streaming or downloading more like the way mp3 juice is or tubidy
I tried different codes, online search but I didn't find anything helpful the best I could get was and I coded it was a link pasting site where you paste the URL of the video then it downloads...I want something that people can just search and have there search displayed there any help is very much appreciated (from any language)
If you are looking to create a website that fetches data from YouTube, you will need to use the YouTube API. The YouTube API allows you to search for videos, retrieve video information, and embed videos in your website. You can find more information about the YouTube API here: https://developers.google.com/youtube/v3/getting-started.
Once you have set up the API, you will need to create a web application that can make requests to the YouTube API and display the results. You can use any language you are comfortable with, such as JavaScript, PHP, or Python.
You will also need to create a user interface for your website, which will allow users to search for videos and view the results. You can use HTML, CSS, and JavaScript to create the user interface.
Finally, you will need to create a way for users to stream or download the videos they find. This will require you to create a streaming or download service, which can be done using a variety of technologies, such as HTML5, Flash, or a third-party service.
Good luck!

if YouTube video is unavailable in rendered iFrame, hide the iframe? (youtube live stream)

I have a React application. I am trying to live stream on YouTube. What i am trying to achieve is, when i am live on YouTube, i want a certain part of the website to show the live streamed video as embedded. When i am not live, i want this section of the website hidden.
I have tried using the google v3 API but the cost of API calls to search for live videos on the channel is too expensive (i was doing a query to the API and if a video returned i would show the iframe on the site, and if not just hide it). However, with this quota and the usage of the site, this is not a suitable solution.
I also cannot render the content in an iFrame and then just 'getElementById' because then i'd get CORS restrictions. I thought about building some sort of proxy that could just get the HTML from the youtube page and return it to me as a string (by passing the CORS issues), then just checking for an ID to determine if the channel was live or not.
I've tried alot of searching but either im looking for the wrong things or there is limited support for what i'm trying to do. Any other suggestions on how i can achieve this please?
thank you in advance

'Some cookies are misusing the recommended “sameSite“ attribute' On OneDrive embedded video

I have embedded a video from onedrive on my website. When I open the site I get an error that goes something like:
Some cookies are misusing the recommended “sameSite“ attribute (10)
The video does not play but after ~5 seconds it opens the onedrive website. Not sure why.
I have tried using google drive but instead of the video I get this
Can someone help me with this.
If I need to provide more info then ask.

Embed youtube video without making extra HTTP request and increasing page size

I run a blog which talks about music. It's a custom Php based CMS and each blogpost has a minimum of 2 videos in it. Now, these youtube videos extra HTTP request and increase page size by 2MB. This is really a concern for me as I'm losing out on google search ranking due to page size and performance issue. I found a way of doing it via this tutorial
(https://www.labnol.org/internet/light-youtube-embeds/27941/).
I have implemented this solution for blogs that I'll be posting from tomorrow but need a solution for blogs that were posted before. Those blogs had youtube embeds via iframe and I do not know how to create a solution for them.
My guess would be to use jquery append & remove? If yes, can someone assist me how do I proceed? Any help will be appreciated.

How can I play a youtube video in a windows 8 store app (javascript)

I've tried a lot of different solutions on the web but none seem to work. Given a youtube key "8sPj0Ic8KQ8" I want to play the video in a Windows 8 metro-style javascript app.
Simple , and tags do not work, no surprise there. My next stop was the Player Framework for Windows 8 Metro Style Applications and Smooth Streaming Client SDK. The examples work since they point to an mp4 file but when I paste a youtube url into the example even that doesn't work.
Next, I noticed there is a "MyTools" framework out there but it's only for C#/Xaml and not javascript. Furthermore the code is not supplied, only DLLs so I don't think converting it is an option.
I also tried WinJS.Utilities.setInnerHTMLUnsafe() suggested here - just get a white box, no video.
Finally, I queried youtube directly for the full page contents and I've been attempting to parse out the mp4 URI myself... without much luck. I also found a PHP library to do what I'm attempting but after converting it to javascript it seems it's either really old or just doesn't work right.
I also tried "?html5=1" in an iframe suggested by this book: Start Here windows 8 with HTML
If anyone has another suggestion I haven't tried or if you've successfully played a youtube video in a javascript metro app I'd be very interested to hear how you did it. Thank you.
UPDATE: I've now been able to successfully extract the mp4 file data from a youtube page. This will let me download the stream to my computer but I'm still unable to play it in a Windows 8 app, all I get is a white box with no controls or error messages. I want users to see videos, not save them.
Finally solved this. The answer is to A) parse the actual URI from the youtube page. B) Use the Microsoft.SmoothStreaming library in combination with a C) video tag. This got youtube videos to play for me in Windows metro style app. If you need help with part A, this site helped me a lot: How to grab youtube playback video files

Categories

Resources