How to embed Ted talks videos with time var - javascript

I'm trying to embed Ted talks videos with a time variable.
On their website, if you add an anchor id like #t-618000 after the url, it works.
Eg. https://www.ted.com/talks/hans_rosling_at_state#t-618000
When I try an embed with the time variable, it does not work :
<iframe src="https://embed.ted.com/talks/christopher_soghoian_your_smartphone_is_a_civil_rights_issue#t-23580" width="640" height="360" frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
How can I find the javascript piece of code using this variable to change the player time?
Thank you

You can set the playback range by including
#t=[starttime][,endtime]
as a fragment at end of URL pointing to media resource.

Related

What is the best way to add a video upload button to my website?

What combination of services can I use to add a video upload button to my website so I can them embed them on said website.
For uploading a video you need to find a service that suits you (YouTube, Vimeo...). This will involve some research and reading through the documentations.
Embedding the video to the website you can use the iframe tag
<iframe width="560" height="315" src="your video url" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

Display YouTube video from URL

I want to load you tube video in my php script.
I have already tried with iframe but it can not work.
I also did some research but it said that load YouTube URL with embed tag, but I want to load without embed tag.
Can you please help me?
If you need to do this within php as you say then you echo an iframe with the address of the YouTube video as https://www.youtube.com/embed/VIDEOID where VIDEOID is the part in the YouTube URL after the v?=, for example this video https://www.youtube.com/watch?v=UaaXEX-MGuk would be embedded as follows:
echo '<iframe width="560" height="315" src="https://www.youtube.com/embed/UaaXEX-MGuk" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>';
Otherwise you can just embed with HTML. Can you provide more detail if this doesn't help?
More here: https://support.google.com/youtube/answer/171780?hl=en
Sign in to your YouTube account on a computer.
On the left side of the page, select the playlist you want to embed.
Copy the playlist ID from the URL.
Modify the embed code for an individual video by doing the following:
In the place of the video ID (after "embed/"), substitute "videoseries?list=".
Then paste the playlist ID after the "=".
Paste the code into your blog or website HTML.
Example:
​<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLx0sYbCqOb8TBPRdmBHs5Iftvv9TPboYG" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
https://support.google.com/youtube/answer/171780?hl=en

Youtube Video Embed iframe shows the wrong video

I am making a website and I have to show a video on its homepage. The video exists on youtube and I need to embed it on my website.
<html>
<iframe width="560" height="315" src="https://www.youtube.com/embed/spPdelVEs_k?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</html>
Unfortunately my webpage shows a completely different video. It shows this one.
https://www.youtube.com/watch?v=7sNL0T93ItM
Does the URL convert to something different? Help me solve this problem.
Your code is fine. You just need to clear the cookies on your browser and then it should load fine for you.
This is the video your code goes to:
https://www.youtube.com/watch?v=spPdelVEs_k

Storing Youtube video URL in firebase, and then inserting URL in <iframe> does not display video

I stored a few youtube URLs in Firebase, and I want to insert them in the html like so:
<iframe width="560" height="315" src="{{main.vid}}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
However, when running the code it only displays a blank. I am using the correct URL when clicking share and then embed on Youtube.
When I replace the Firebase data URL with the normal one like so:
<iframe width="560" height="315" src="https://www.youtube.com/embed/6CulBuMCLg0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
it works fine. Any help?
It looks like you are using Angular or something similar.
Angular sanitizes URLs before string interpolation for security reasons.
You need to bypass the sanitizer. A possible solution is a custom pipe.

Embed Youtube with Captions on by default not working

I'm trying to embed a Youtube movie, and would like Captions to be on by default.
From https://developers.google.com/youtube/player_parameters#cc_load_policy I understand I should use cc_load_policy=1.
I use the code html code below but it doesn't seem to work. That is, it loads with the captions off (you can manually turn captions on, so the video does have captions). What am I doing wrong?
I've tried the following two options:
<iframe src="https://www.youtube-nocookie.com/embed/xxxxxx?rel=0&&showinfo=0&cc_load_policy=1" frameborder="0" allowfullscreen></iframe>
<iframe src="https://www.youtube-nocookie.com/embed/xxxxxx?rel=0&&showinfo=0" cc_load_policy="1" frameborder="0" allowfullscreen></iframe>
Try adding cc_lang_pref , you wouldn't find in the official docs. but it's required
cc_load_policy=1&cc_lang_pref=en
You can change pref. language as per the locale representation of the language you have put in the video caption

Categories