YouTube Data API - embedding paid for videos - youtube-api

Is it possible to embed a player (perhaps YouTube) into a website which plays movies rented or purchased via Google Play?
My end goal is to have a user purchase a movie via Google Play, then have that movie available to watch within the site.
I've purchased a movie for testing purposes - https://www.youtube.com/embed/kX1uUmXNNII.
When I load that link while logged in to Google, the movie plays. Open a private tab, same link, and I get the trailer - which makes sense.
So far I've got OAuth set up with a YouTube Data API along with an iFrame
<iframe width="100%" height="600px" src="https://www.youtube.com/embed/kX1uUmXNNII" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
When I login and redirect back, the same link errors with Your browser does not currently recognize any of the video formats available.
Which seems to not be correct, given I'm running a recent version of Chrome. Previous attempts with another set of Google API credentials caused it to play the trailer to the movie.

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'?

Playback on other websites has been disabled by the video owner (But it's not)

Please check this video. It's one from my video channel https://www.youtube.com/watch?v=lgFXZP8K7Ew
My problem is when I embed this video on my site it shows me this message (https://ibb.co/r3mvsfH). But "Allow Embedding" is checked on the video (https://ibb.co/z6BzGVD). I have two YouTube accounts under the same mail address and all videos from both of them shows "Playback on other websites has been disabled by the video owner"
FYI, It's not live streaming, just the normal video clips from my account.
Tried everything, every troubleshoot; same results.
This is the code I was trying to put
<iframe width="560" height="315" src="https://www.youtube.com/embed/lgFXZP8K7Ew" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
This is something that only the video owner can enable. YouTube can not do anything about it. All you have to do is to allow the users to play the video on YouTube itself if this error occurs. For additional information visit: How to play Youtube live stream video in application?

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.

Pause youtube video when soundcloud audio is playing

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.

Embedded YouTube Videos - Removing Videos at End

At the end of a YouTube video you will see other videos that you can choose to watch if you choose. I am embedding a YouTube video on my site and would prefer that those videos did not show at the end of the video. Is there a way to remove those videos and have just a reply option (or something similar). According to this question you can remove the annotations from YouTube Videos that are embedded on your site and that made me wonder if the same can be achieved for end of video videos.
Yes that is possible, use this script:
<iframe width="560" height="315" src="http://www.youtube.com/embed/{link}?rel=0" frameborder="0" allowfullscreen></iframe>
The important part is the ?rel=0.
The functionality of this changed on Sept. 25th 2018.
The behavior for the rel parameter is changing on or after September 25, 2018. The effect of the change is that you will not be able to disable related videos. However, you will have the option of specifying that the related videos shown in the player should be from the same channel as the video that was just played.
https://developers.google.com/youtube/player_parameters?csw=1#release_notes_08_23_2018

Resources