Get iframe url after clicking play icon - javascript

I have multiple YouTube iframe videos. I am trying to get url of current clicked iframe. I tried like by giving iframe id but its not work.

Related

How to get YouTube video URL from channel Id

I want get video URL of my live channel
I know https://www.youtube.com/embed/live_stream?channel=UChF0CL3nPrnp7q3hfbvVg6A is permanent video URL but i need
URL like https://youtu.be/xxxfd or https://www.youtube.com/watch?v=xxxxdfd
Is there any API to get it programmatically
1)Use the youtube site to find the video you want.
2)Click the 'Share' button below the video.
3)Click the 'Embed' button next to the link they show you.
4)Copy the iframe code given and paste it into the html of your web page.

Prevent iframe playing youtube video

Is there an option in iframe to prevent it from playing video i.e. I have following iframe:
<iframe src="https://www.youtube.com/embed/v2ifWcnQs6M" width="468" height="60" ></iframe>
I want to display just the thumbnail of youtube video with red 'play' button in the center of thumbnail, but disallow user to actually play video. Is there a way to do it ?
Because as I checked Youtube IFrame API there is no solution for getting youtube video id i.e. I have to parse url by myself and then construct the following url:
https://img.youtube.com/vi/video_id/0.jpg
And besides this url returns thumbnail without red 'play' button which I also want. So is there an HTML attribute in iframe or js workaround to do it ?
Add a transparent div on top of the YouTube video with CSS.
See example.
No. No such attribute. If you dont want to allow users play that video, you need to construct block manually. Get the thumbnail and create or cut play button image. Then within CSS write layout rules and show to user this constructed block

Youtube player force playlist dropdown to open

Does any body know, how to force a playlists dropdown to open in an embeded youtube player. I have an iframe with HTML5 youtube video player in it and I load the playlists dynamically.
I want the dropdown to open, when playlist is changed. I tried to create a click event inside an iframe, but console says that it is not allowed. I also didn't find any functions in their reference.

Change fancybox title when iframe changes location

Is there a way to dynamically change the title on a fancybox after it has loaded -- at any time using javascript?
I'm using a fancybox iframe and want to dynamically show the url of the iframe even if the user clicks around inside the iframe and goes to different locations.

Open Youtube video in a new window?

I am using the following html to embed youtube window in page,
<iframe src="http://www.youtube.com/embed/VIDEO_ID" width="320" height="190"></iframe>
Is it possible that when I click the play, it should redirect me to the youtube page.
I use another div to cover the real iframe element. So when user click on the place they think the iframe, the div onclick event is fired.
You can see a demo here http://jsbin.com/uhajun/2/edit

Categories

Resources