youtube-iframe-api

Hide related videos Youtube Iframe API

旧街凉风 提交于 2019-12-10 17:14:28
问题 I am trying to hide related videos that shows up when you pause a video but as I found out from similar questions that as of September 25th 2018 there is no way to disable the related videos from displaying. 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. To be more specific: Prior to the change, if the

The target origin provided does not match the recipient window's origin: audio is coming but not video

心不动则不痛 提交于 2019-12-10 14:55:27
问题 The complete error is "Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://localhost:8100').", this is what im doing in index.html file, the audio is coming but video is not. <script> var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag,

youtube-iframe-api closed captioning troubles

最后都变了- 提交于 2019-12-09 13:30:08
问题 Spent a better part of yesterday 6/12/2017 trying figure out why my captioning was not working when I was using the YouTube iframe embed code (generated from the Share > Embed button). After much experimentation, I narrowed the problem down to what has already been identified. Closed captioning was not working as the captioning was automatically generated. Once I manually created the closed captioning, everything seemed to work fine. I didn't even have to use the cc_load_policy=1 parameter.

show playlist menu in youtube embed

与世无争的帅哥 提交于 2019-12-08 18:21:10
问题 In the top left corner of a youtube playlist embed there is a button to open the playlist menu. I'm trying to have this list opened programatically in the page load. Is there a way to accomplish that? I think this can be accomplished with contentWindow.postMessage but I have no idea what function to use. I could not find any documentation. Playlist embed code: https://www.youtube.com/embed/NU1rsLIdpNA?list=PLdIivvLumeIVQHwOsZLYqp3-LZ75X1WKO 来源: https://stackoverflow.com/questions/39104339

youtube iframe api parameter rel=0 doesn't work

杀马特。学长 韩版系。学妹 提交于 2019-12-08 16:31:42
问题 I need to hide related videos after watching the video. I set rel=0 , but it is not working. I am using this page for testing. The rel checkbox value doesn't affect on shown related videos after watching video. It doesn't work in google chrome. In mozilla firefox it properly works. 回答1: As of September 25, 2018, you are not be able to disable related videos. Instead, if the rel parameter is set to 0, related videos will come from the same channel as the video that was just played. YouTube API

Stop any embeded YouTube iframe when another is played

[亡魂溺海] 提交于 2019-12-07 11:17:32
问题 I am embedding about 10 YouTube iframes in my page, all with their own custom play/pause buttons. I have used this solution to begin http://jsfiddle.net/buuuue/dzroqgj0/ but I'm not sure how to tweak this piece of the code to stop ANY other video that is playing if another one begins... function stopVideo(player_id) { if (player_id == "player1") { player2.stopVideo(); } else if (player_id == "player2") { player1.stopVideo(); } } For example, if player 1 is currently playing, and player 3 is

Embed Youtube with Captions on by default not working

一笑奈何 提交于 2019-12-07 10:45:05
问题 I'm trying to embed a Youtube movie, and would like Captions to be on by default. From https://developers.google.com/youtube/player_parameters#cc_load_policy I understand I should use cc_load_policy=1 . I use the code html code below but it doesn't seem to work. That is, it loads with the captions off (you can manually turn captions on, so the video does have captions). What am I doing wrong? I've tried the following two options: <iframe src="https://www.youtube-nocookie.com/embed/xxxxxx?rel

YouTube HTML5 API - Is it possible to get better time resolution when polling the player for current time?

寵の児 提交于 2019-12-07 04:11:46
问题 I've been looking for a solution for this for a while now and I still haven't found it. Our app needs to poll a YouTube video object using player.getCurrentTime() to drive some screen animations. Using the flash API this was great because we could poll the player at 40ms intervals (25 FPS) and get very accurate current player time values. We have now started to use the iFrame API which unfortunately does not allow anything near that level of accuracy. I did some research and it seems that

Detect youtube iframe autoplay failure

匆匆过客 提交于 2019-12-06 15:19:04
iOS and Android only allow playing a video inside a callback of a user interaction. Chrome 66 introduced the autoplay policy . How can we detect that embedded youtube iframe failed to autoplay a video so we can play it muted and show 'tap to unmute' button? The API has onError callback but it's not clear if and what error will fire. This is also hard to test because of Chrome's Media Engagement Index. HMTL 5 video autoplay failure can be detected. Is there an equivalent in the YouTube iframe API? var promise = document.querySelector('video').play(); if (promise !== undefined) { promise.then(_

Embedding most recent YouTube video with Channel ID

拈花ヽ惹草 提交于 2019-12-06 15:18:48
问题 I am building a website for a friend and I'm having some trouble with the YouTube player API. This is the embed HTML IFrame I have so far: <body> <iframe style="max-width: 480px" width="100%" height="360" src="http://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=UCvDJ_vg2dics1kmwUPnTo_A" frameborder="0" allowfullscreen></iframe> </body> This does not work due to the fact that his YouTube channel uses the new ID system and it doesn't detect that in