Embedded YouTube Video to Auto Play Muted? - youtube

I have 6 videos on my site and i've added autoplay and loop to them, but i would like them to play with no audio, how can i do that ?
This is how the code looks https://www.youtube.com/embed/s0qLJ4geZko?autoplay=1&loop=1&playlist=s0qLJ4geZko
If i'm allowed to post the link to my site, please let me know.

Yes you should add mute=1 to the string in order to play it in mute by default...
https://www.youtube.com/embed/s0qLJ4geZko?autoplay=1&mute=1&loop=1&playlist=s0qLJ4geZko

Apparently they already play muted, so problem solved.

Related

Embedded YouTube Video won't play with ?autoplay=1

Any thoughts on why the embedded YouTube video won't autoplay on this site?
https://quantumleapin.wpengine.com/
As far as I can tell the autoplay is integrated correctly…
Your src attribute is not formatted correctly, it reads :
https://www.youtube.com/embed/T8u41Uy7wNw?rel=0&showinfo=0?ecver=1?autoplay=1
It should be :
https://www.youtube.com/embed/T8u41Uy7wNw?rel=0&showinfo=0&ecver=1&autoplay=1
Same thing was happening to me and I copied the embed code exactly from YouTube and it included that ?ecver=1 which was making it not play. Once I removed ?ecver=1 it was ok.

Unusual issue: Youtube iOS player helper "restricted from playback on certain sites." message, but works on Android

I know this question seems to have been asked before, but it apparently hasn't (at least on stack overflow). I get the following error using Youtube iOS helper api for certain videos when I attempt to embed them in my iOS app.
"This video contains content from VEVO. It is restricted from playback on certain sites."
The error below is fairly self explanatory... and it appears that there is nothing you can do about it. I can live with that. But there is more to it.
The reason I am puzzled by this message (and it refers to any VEVO music video on Youtube) is that the videos play on Android. Someone else has also had this problem... stated here: https://github.com/youtube/youtube-ios-player-helper/issues/52
If there is a restriction on other sites - and there may well be - it should be restricted on both iOS and Android devices. I find it highly odd that the restriction applies to only iOS.
Can someone advise?
Cheers!
add this in your playerVars #"origin" :#"http://www.youtube.com" it will work. I had the same problem.. i solved it using playvars
According to this answer,
...iOS devices use iframe so they basically embed. Android devices that
use player API can check syndicated.
From the documentation: if a video is embeddable, it can be embedded into a webpage, and if it is syndicated, it can be played outside of youtube.com.
A video that is embeddable but not syndicatable will play on YouTube.com or on other sites that embed the YouTube player, but may not play on devices such as mobile phones or TVs (source). Therefore, if a video plays on Android but not on iOS, it's possible that it's syndicateable but not embeddable, in which case it's working as intended.

Youtube ios player helper can't play video

I am using this library https://github.com/youtube/youtube-ios-player-helper
in my project. The player works well if I use the video Id given by the sample (M7lc1UVf-VE). If I use the video Id from r random video on youtube it shows:
An error occurred, please try again later. Learn More
Do I need to enable a youtube data API or something like that???
cause I see another IOS Youtube helper needs to do so.
https://github.com/youtube/yt-direct-lite-iOS
Thanks.
add this in your playerVars #"origin" :#"http://www.youtube.com" it will work.
If you only want to play youtube video, no API access is needed.
I work on with this library without any error, did you replace "M7lc1UVf-VE" with the correct video id?

Video restricted from playback on certain sites, even though embed is allowed

I am creating an iOS app that uses the youtube iOS player helper. It works fine, but for some videos, when trying to play them, I get 'This video contains content from [YYY]. It is restricted from playback on certain sites'.
The metadata for one of the videos that doesn't work is here: http://gdata.youtube.com/feeds/api/videos/KJB49SAHIKM?v=2&prettyprint=true.
And http://gdata.youtube.com/feeds/api/videos/dRgPi1OPBeA?v=2&prettyprint=true is the metadata for a video that works.
The embed permission seems to be the same. What could the problem be? Is there something I'm missing?
I know that 'syndicate' is denied for the video that doesn't work, but I also have a video with syndicate and embed allowed that doesn't play and gives the same error, so I assume there must be something else.
Also, I have access to the channels that uploaded those two videos. Are there any settings for the individual videos that have to be set for them to be able to be embedded?
Add player vars while initializing youtube sdk:
NSDictionary *playerVars = #{
#"origin" : #"http://www.youtube.com",
};
[self.playerView loadWithVideoId:#"KOvoD1upTxM" playerVars:playerVars];
Enjoy!
I had the same issue but it seems like its due to the fact that publishers have restricted the video to be played outside youtube.com. If you own the channel and videos then probably you have a setting that restricts playback of videos outside youtube. For other videos that I dont have access to I put an option to watch it on youtube that would fire up native youtube app with the video loaded.

Muting an AVPlayer playing Http Live Streaming video

I was wondering if I could mute the sound of an AVPlayer playing a HTTP Live Streaming video?
I've already try several things, like the Apple method to set the volume of an AVPlayer explained here but it works only for local files... (cf. the note at the bottom of Apple documentation).
The similar method explained in this post does not working either.
Is there an solution? I really don't want to mute the sound of the device but only one video while other players could have their own audio (the user could balance audio between players).
Thanks in advance.
iOS 7.0 now provides support for muting the player using
[AVPlayer setVolume:(float)volume]
It also works for HTTP Live Streaming, my app is making extensive use of it.
According to the AVFoundation team, it is impossible to mute or disable a track of an HLS video.
You can mute the entire audio session using MPMusicPlayerController shared instance.
[[MPMusicPlayerController applicationMusicPlayer ]setVolume:0];

Resources