youtube-iframe-api

Youtube channel livestream embedded doesn't work

时间秒杀一切 提交于 2019-12-13 21:26:50
问题 I'm using iframe for embed youtube channel in my site, but it shows "An error ocurred. Please try again.". Strangely, if I set another channel ID it works. The channel ID that doesn't work The channel ID that works I copied the debug information just in case: { "cpn": "hWjSQIlGKWCb1Abv", "vct": "0.000", "vd": "NaN", "vpl": "", "vbu": "", "vpa": "1", "vsk": "0", "ven": "0", "vpr": "1", "vrs": "0", "vns": "0", "vec": "null", "vvol": "1", "creationTime": 65805, "totalVideoFrames": 0,

onReady event not firing on IE11

烈酒焚心 提交于 2019-12-13 21:13:46
问题 onReady event are not being fired on IE11 & Edge, but it's working fine on IE10, Firefox, Safari and Google Chrome. I'm using the javascript api to mute a video when the page is loaded. This is the code i wrote. (Note. I'm using Drupal) (function ($) { function onPlayerReady(event) { event.target.mute(); } function muteVideos(video_ids) { for (var iframe_id in video_ids) { var player = new YT.Player(iframe_id, { videoId: iframe_id, playerVars: { "enablejsapi":1, "origin":document.domain, "rel

Youtube's onStateChange is not fired if play is triggered by postMessage

时光总嘲笑我的痴心妄想 提交于 2019-12-13 02:58:16
问题 If the youtube playVideo is triggered by postMessage, the onStateChange will not be fired. (http://jsfiddle.net/nedvedyy/smx92nq0/). Any one runs into it before? <script src="jquery-1.10.2.min.js"></script> <!-- 1. The <iframe> (and video player) will replace this <div> tag. --> <div id="player"></div> <button class="button">BUTTON</button> <script> // 2. This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = "https://www.youtube.com

Adding showinfo=0 to youtube iframe doesn't always work

↘锁芯ラ 提交于 2019-12-13 02:57:42
问题 I'm using the following code to add the Youtube video to the website (with showinfo=0 parameter): <iframe width="560" height="315" src="https://www.youtube.com/embed/qTLOQCSwMpM?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe> showinfo=0 does successfully remove the top panel with share & watch later buttons in most browsers, but not everywhere . I noticed that on Chrome 62.0.3202.94 on Windows 10 it's still showing that panel: How do I get rid of it on all browsers? 回答1

Prevent iframe playing youtube video

偶尔善良 提交于 2019-12-13 02:12:36
问题 Is there an option in iframe to prevent it from playing video i.e. I have following iframe: <iframe src="https://www.youtube.com/embed/v2ifWcnQs6M" width="468" height="60" ></iframe> I want to display just the thumbnail of youtube video with red 'play' button in the center of thumbnail, but disallow user to actually play video. Is there a way to do it ? Because as I checked Youtube IFrame API there is no solution for getting youtube video id i.e. I have to parse url by myself and then

How to prevent Iframe video go beyond max-width & max-height?

喜欢而已 提交于 2019-12-13 01:45:55
问题 I embedded a responsive youtube video with bootstrap. My aim: keep it's max size width="560" height="315" which is then centered. How it should be: https://avexdesigns.com/responsive-youtube-embed/ But instead it goes beyond these limits, making the video very blurry. How it should not be: https://bomengeduld.github.io/mos-man2/ So far I tryed to set max-width & max-height in css, but it only adjusts the width. What Am I Doing Wrong in this Code? Thank you in advance for clearing this up! 回答1

YouTube Player API live stream duration

旧时模样 提交于 2019-12-12 03:18:31
问题 I'm using YouTube iFrame API for controlling YouTube video in my page. Biggest problem I have is with live streams which I can't get exact duration, but the biggest problem is some kind of a buffer window. For example I have a stream that is 3h long, but when a user comes in after 3 hours, he can only get the last 2 hours of the video. So first hour of the video is not accessible to the user. Does anyone knows why? And how can I get that "time window" length? Because in couple of videos that

YouTube iframe api (existing iframe); Cannot get iframe-api to work

懵懂的女人 提交于 2019-12-11 08:31:18
问题 I am making a "video cycler" which will allow us to have multiple videos on one website; but only have one of them large. The plan was to have them "auto cycle" when the video is finished playing. I was going to use the onStateChange feature to figure out when I should cycle them. All is going well expect for the fact that I cannot seem to get the api to work. (using a different videoID because the real video isn't public yet) HTML: <iframe id="video0" width="640" height="385" src="https:/

How can I add an event listener that triggers whan a certain type of element is added to the DOM?

余生长醉 提交于 2019-12-11 01:58:15
问题 I want to call a specific method whenever a new iframe is created in the current window . It is youtube iframe player i need to listen to new iframes whenever it is created or enabled in current window . is it possible to do something like that ? Please let me know if there is any way .I have tried the below code but this code wont detect the new iframes which is dynamically created . I tried in google but didn't get any info const iframes = document.getElementsByTagName('iframe'); forEach

Youtube API Dynamic iFrame

北城以北 提交于 2019-12-10 17:44:16
问题 I'm trying to load a youtube video dynamically (iframe is generated on click after the page has loaded) with the ability to control the playback using the Youtube API. What I have found is that if the iFrame is not present on the page when the API is loaded I can't seem to get the controls to work. What am I doing wrong? (I would like to avoid a solution that includes having the iframe present on the page when it is loaded) Here's some example code: https://jsfiddle.net/nu1y9oe8/5/ (Click on