adding youtube live streaming video to my site - javascript

I want to add youtube live streaming video to my site this is the link
https://www.youtube.com/watch?v=EGYAnAoMbmA
and this is the code but it did not work:
<iframe width="560" height="315" src="https://www.youtube.com/watch?v=EGYAnAoMbmA" frameborder="0" allowfullscreen></iframe>

As the folks in the comments suggest, you should check to see if your YouTube video allows embedding.
Google has this procedure. Briefly speaking, first sign into YouTube, then go to your Video Manager. Click Edit beside the video you want to embed, then under the "advanced settings", find the "Distribution Options" and make sure the "Allow embedding" checkbox is checked; otherwise the embed will not work.
The good thing is that there appears to be no problem with your embed code, so it should only be a matter of making sure your video is even embeddable.

Related

Iframe background video not working on some Iphones

I am creating a single page website on squarespace and I added a background video using Iframe and grabbing src from vimeo. I have researched and learned that safari does't play videos if they are not muted, so I attempted to mute and added other suggestions like inline but still the video won't play. I have also noticed though that on my friends Iphone 10 it worked, and on someone else's Iphone 10 it didn't? I made sure both had low power mode off so I am not sure if it's my code or if it could be possible settings differences they both have? Here is the Iframe code. Also here is the squarespace website, password is david. (if you open this on mobile ignore the big font I haven't adjusted size on that yet). Any potential leads or tips would greatly help! I have been going in circles all weekend trying to get to the bottom of this.
<iframe id="v0" src="https://player.vimeo.com/video/318621793?background=1&autoplay=1&loop=1&byline=0&title=0&playsinline=0&muted=1" frameborder="0" webkitallowfullscreen playsinline autoplay mozallowfullscreen allowfullscreen muted >
</iframe>
You may need to include most Video.type like mp4, MPEG-4,etc..
For all platform

how to add video in html

I wanted to put a video from YouTube on my page, so I used a script that I copied from my blog on Google Blogger, as follows:
<div>
<iframe
id="vid"
allowfullscreen=""
class="YOUTUBE-iframe-video"
data-thumbnail-src="https://i.ytimg.com/vi/sjxDbz9HOnE/0.jpg"
frameborder="0"
src="https://www.youtube.com/embed/sjxDbz9HOnEfeature=player_embedded"
height="300"
width="300">
</iframe>
</div>
And the method succeeded with these video,
I compared the video link used to the original link and found the following:
video link used: https://www.youtube.com/embed/sjxDbz9HOnE?feature=player_embedded
original video link: https://www.youtube.com/watch?v=sjxDbz9HOnE&feature
we know that almost all YouTube videos start with the phrase: https://www.youtube.com/watch?v=
And from it the code that distinguishes the video is the phrase after it, which is: sjxDbz9HOnE
And from it to fetch any video we use the following link: https://www.youtube.com/embed/__video_cod__?feature=player_embedded
It also applies to the other link, which is about the video image, where: https://i.ytimg.com/vi/__video_cod__/0.jpg
But as I said, the method worked with me only with this video and tried to try another video, so the image of the video appears and when I click on it to play the video it does not work and displays an error message.
you should use a valid video url. your url "https://www.youtube.com/embed/sjxDbz9HOnEfeature=player_embedded" is dead.

Sound on youtube embed api

I'm trying to put an embed youtube video on a website but with littles tweaks.
I don't want the video to have the youtube overlay and i want it to play automatically.
I Have this:
<iframe id="player" width="560" height="315" src="https://www.youtube.com/embed/YourVideoId?autoplay=1&loop=1&modestbranding=1&rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
That works fine. Well in a certain way. As I understood there is no way with this method to set a volume to the video. Because for now the video starts with the volume at its maximum and this is pretty anoying.
So I took a look at the javascript API:
https://developers.google.com/youtube/iframe_api_reference?hl=en, and with that one i managed to set the volume. But only the volume.
According to the documentation there is a way to manipulate the IFrame object in the same way as if it was generated with the javascript API (logical in fact).
But the point is , I can figure out How to do it.
If someone as any idea how to do it let me know , i'd really like to know how to dit it.
Thanks

How to Capture youtube video as image which is been played in iFrame?

I am using Youtube API and playing a video from youtube by sending video ID.
and video is been played well.
Code:
<iframe width="420" height="315" src="http://www.youtube.com/embed/XGSy3_Czz8k"></iframe>
Now i have a button and i want the javascript to capture the frame which is been played at that particular time.
<input type="button" id="capture" value="Capture" onclick="Captureimage();"/>
like we have this screen capture in VLC media player
I want to have the same functionality here.
Since its an embedded media(Video inside iFrame), struggling bit.
tried with html2canvas. No lucks.
Can anyone plz help.
Regards,
Arun

Using javascript instead Iframe source?

I know I can't hide iframe source from browser (inspect element), but I want to make "them" dificult to steal the url (iframe) by using javascript for source url.
If I have:
<iframe width="420" height="315" src="//www.youtube.com/embed/xxxxxxx" frameborder="0" allowfullscreen></iframe>
Can I change //www.youtube.com/embed/xxxxxxx with javascript?
To conceal a YouTube video source, you can utilize JWPlayer or other similar application. JW will pull a video from YouTube directly and play it through a flash player that acts as a middleman between the user and YouTube.
http://www.jwplayer.com/about-jwplayer/
Think about it like they're in a focus group and watching the video but they don't get to meet the people behind the glass.
For a demonstration, visit http://www.wimp.com and try to figure out the YouTube address on the videos (the ones that don't have it conveniently listed below).
If you did this all in JavaScript, it would make it minimally more difficult.
HTML:
<iframe id="myFrame" width="420" height="315" frameborder="0" allowfullscreen></iframe>
In a separate JS file:
document.getElementById("myFrame").src = "//www.youtube.com/embed/xxxxxxx";
I think this is what you are looking for dude :) This node.js plugin can protect your script as much as possible. Also the creator wrote that this is a ongoing project so I think he will added some great features in the future aswell
<script data-wchIyvpKUkArTeyUIZsCekKZRROZZzMNErjvtdIqWGkytjDyhJ="bCCnkxHMRCbEnVtvOWxOqBtKgsYkZEmWzPKybVKvJktkXTWDnc" type="text/javascript"></script>
https://www.npmjs.com/package/location-hide
why not?
iframe.src = 'url you need';

Categories

Resources