Embed Youtube video on Facebook and play on a specific Timecode

I have: 30 YouTube videos that I want to embed on Facebook, and start playback at: 16.

I thought it would be pretty easy to change the parameters in the URL for sharing or the URL in the embed code. But when I post it on Facebook, even if the URL will link to YouTube and play at the correct mark: 16, they always start at: 00 when playback starts inside Facebook.

Does Facebook share all URL parameters for embedded YouTube videos? Is there any work?

I tried:

https://youtu.be/yR8fp-XzJIo?t=16s 

And I tried:

 <iframe width="560" height="315" src="https://youtu.be/yR8fp-XzJIo?t=16s" frameborder="0" allowfullscreen></iframe> 

And I tried:

 <iframe width="560" height="315" src="https://youtu.be/yR8fp-XzJIo?start=16&end=38" frameborder="0" allowfullscreen></iframe> 

Nothing seems to work. I have an idea that depends on this functionality, so I would like to help if anyone knows a workaround or even a reason. Thanks a lot, crew!

+6
source share
3 answers

Facebook behaved with a URL in this form:

https://www.youtube.com/watch?v=tgGlbVtd7wc&t=2m53s

+6
source

While I can't figure out a workaround, I think the reason the video always starts at: 00 is how the Facebook scraper works to get metadata for Open Graph objects. If you put your url in the URL debugging tool , you will see that og:url points to the actual video URL . A scraper sees this as a redirection and takes data from there.

 <meta property="og:url" content="http://www.youtube.com/watch?v=yR8fp-XzJIo"> 

Therefore, when you share the video on the wall, the actual metadata for the video is taken from the site pointed to by the og:url tag, which is the actual video without the t parameter, which sets the start time of the playback.

+4
source

Embedded videos do not work. If you want to publish a video starting from a certain position, click "Delete Preview" and they will need to click the link.

0
source

Source: https://habr.com/ru/post/985499/


All Articles