Pause youtube video when soundcloud audio is playing - youtube-api

How to pause a youtube video when soundcloud audio paying and vise versa
<span class="soundcloud_embed" id="soundcloud_post_312">
<iframe id="ui-id-1" width="100%" height="300" scrolling="no"
frameborder="no" src="https://w.soundcloud.com/player/?
url=https%3A//api.soundcloud.com/tracks/163100334&
color=%23ff5500&
auto_play=false&hide_related=false&show_comments=true&
show_user=true&show_reposts=false&show_teaser=true&
visual=true">
</iframe>
</span>
<span class="youtube_embed" id="youtube_post_309">
<iframe id="ui-id-2" width="560"height="315" src="https://www.youtube.com/
embed/M7lc1UVf-VE" frameborder="0" gesture="media"
allow="encrypted-media" allowfullscreen></iframe>
</span>
I've found the source at this link
Pause Youtube embed when playing Soundcloud embed
http://jsfiddle.net/Lpq9n7ht/

If you need to control the player, you need IFrame API.
The IFrame player API lets you embed a YouTube video player on your
website and control the player using JavaScript.
Read through the documentation to get started. There is starter guide that will help you how to use the API. Codes are also available as your reference depending on the functions that you want to use.
For the requirements, remember this.
The user's browser must support the HTML5 postMessage feature. Most
modern browsers support postMessage, though Internet Explorer 7 does
not support it.

Related

YouTube livestream chat replay not working

I want to display my YouTube Livestream chat replay.
This is the code I tried:
<div id="live-stream-container">
<iframe width="835" height="505" src="https://www.youtube.com/embed/VIDEO_ID" title="YouTube video player" frameborder="0" ></iframe>
<iframe allowfullscreen="" frameborder="0" height="505" src="https://www.youtube.com/live_chat?v=VIDEO_ID&embed_domain=MY_DOMAIN.com"></iframe>
</div>
ps: I have input the correct video ID in VIDEO_ID & MY_DOMAIN is correctly input.
When I run this code, I am able to successfully watch my Livestream again. But, the Livestream chat replay does not appear.
It shows: "Chat is disabled for this Livestream."
I further went to research on Google and set this:
Allowed embedding in YouTube studio
Made it 'Not for kids'
No, don't restrict my video to viewers over 18 only
Allowed all comments
Livechat replay is enabled
But my code still doesn't work, it keeps showing 'Chat is disabled for this Livestream '.
ps: The Livestream ended about 20 hours ago, so the video has been processed.
Can someone guide me in the right direction to display my 'Live chat Replay'?

Youtube Live Stream embed code shows "Live stream offline"

I have a channel in youtube and want to show in my website the live stream videos, if I have a live stream in youtube.
I have followed instructions from https://www.youtube.com/features and enabled both "Live Stream" and "Embed live streams" options, but every time I have a live stream the youtube shows me "Live stream offline" on player.
I have embed the iframe in my website like this
<iframe width="650" height="400" src="https://www.youtube.com/embed/live_stream?channel=myChannelId" allow="autoplay" frameborder="0" allowfullscreen></iframe>
also I have tried setup this gaming url
<iframe width="650" height="400" src="https://gaming.youtube.com/embed/live_stream?channel=myChannelId" allow="autoplay" frameborder="0" allowfullscreen></iframe>
And also I cannot enable "Monetization" from features, because it is disabled and not available from our country.
Can anybody help me to find a solution ?
This works for me. Same as you minus the allow autoplay property.
<iframe width="100%" height="602" src="https://www.youtube.com/embed/live_stream?channel=MyChannelId" frameborder="0" allowfullscreen></iframe>
There is a brief delay, and sometimes you have to refresh the page.

Autoplay embedded Youtube playlist

I followed the instructions on this page
and the embedded Youtube playlist which should Autoplay is:
<iframe width="535" height="300" src="https://www.youtube.com/embed?listType=playlist&list=PL8kx4WFqlOK90fxZpao5k2WUEmSPchGhR&autoplay=1&loop=1" frameborder="0" allowfullscreen>
</iframe>
It does loop when it reaches the last clip, but it won't play automatically on page load. Is there a fix for this, please? Thanks.
PS. I know this question has been asked before, but I could not find a working solution for this.
Try this:
https://www.youtube.com/embed/videoseries?list=PLElJF-XLNL2Brb_dTiVNSe9qld1eR_Jft&autoplay=1&loop=1
Google Chrome:
Since Google Chrome removed non-muted autoplay functionality in version 66, you have to add the parameter "mute=1" in that browser.
Or change autoplay-policy in the chrome settings:
How to allow video autoplay in a Google Chrome kiosk app in version 66 or later

How to play VEVO Content using YouTube iframe API?

I need to play VEVO videos on an HTML5 player which is created using YouTube's API in iOS.
https://developers.google.com/youtube/iframe_api_reference
Currently I'm able to play normal videos with out a glitch.But when ever i try to play a VEVO video,It says "The content cant be played outside of YouTube".Is there any legal way of going about this?.
I have already tried to set the "origin" property of the player to my domain.This did not help.
This is an Example from the above link where the origin is set
<iframe id="player" type="text/html" width="640" height="390"
src="http://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1&origin=http://example.com"
frameborder="0"></iframe>
If anyone knows of any other way to legally play VEVO content please let me know. :).Any legal loopholes will also do :D.
I have played some vevo videos just by placing the ID.
Sometimes vevo videos have certain restractions for embedding like for example, the country from the user is fetching the video.

Adding youtube player in HTML5 without flash

Can we add Youtube player in a HTML5 & javascript page without using flash. I need to make an application which uses youtubeplayer & could be played on differnet platoforms e.g. ios,android
(iOS doesn't support flash)
Here you have the code for embed videos with fallback to flash for those who doesn't support html5.
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>
More info here http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html

Resources