youtube-iframe-api

onYouTubeIframeAPIReady on Angular2 can't find name 'YT'

安稳与你 提交于 2020-01-11 09:42:22
问题 I'm trying to insert the YouTube embed API on my angular 2 project, built with angular cli. I get a "can't find name 'YT'" when I try the approach commented on this question: onYouTubeIframeAPIReady not firing on angular2 web app My service code looks like this: loadAPI() { var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

onYouTubeIframeAPIReady on Angular2 can't find name 'YT'

时光总嘲笑我的痴心妄想 提交于 2020-01-11 09:42:11
问题 I'm trying to insert the YouTube embed API on my angular 2 project, built with angular cli. I get a "can't find name 'YT'" when I try the approach commented on this question: onYouTubeIframeAPIReady not firing on angular2 web app My service code looks like this: loadAPI() { var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

Are there still any remains of Flash on YouTube for Chrome?

青春壹個敷衍的年華 提交于 2020-01-05 08:04:34
问题 I'm working on a Chrome extension and would like to know if there are still any remains of Flash use in videos on Youtube? When I checked two weeks ago Flash was still in use for live stream, but when I checked today I was happy to see that the live stream is now also using HTML5. Now I can't take a risk so I would like to know please if there is still any Flash use somewhere in videos in the YouTube world? I already spent hours of making my extension to work with the Flash player, so I will

YouTube Java Script player.setPlaybackRate() API no longer working

↘锁芯ラ 提交于 2020-01-04 03:25:28
问题 The Google example demonstrates the problem best: https://developers.google.com/youtube/youtube_player_demo Change the "Rate" and you will see the video rate/speed does not change. 回答1: Not sure why the setPlaybackRate doesn't work in the YouTube Player Demo website, but it surely works if your try it. This is the code I used and you can check the working jsfiddle: // 2. This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = "https:/

Can I change the view of a 360 YouTube video with the gyroscope in the browser?

断了今生、忘了曾经 提交于 2020-01-01 19:48:13
问题 I would like to embed a 360 youtube video into a web page and then allow the user to 'look around' by affecting which direction of the video is displayed based on the phone's gyroscope. Does Youtube provide an API for this level of control in the browser? (See here for an example of a 360 youtube video: https://www.youtube.com/watch?v=gQEyezu7G20) 回答1: The YouTube IFrame API (API for embedding a YouTube video into a webpage) doesn't currently allow for controlling pan/tilt of 360 degree

youtube video in chrome extension content script

旧城冷巷雨未停 提交于 2019-12-25 13:45:15
问题 I am trying to insert youtube videos with the iframe API in to an existing page with the help of a chrome extension content script. But I cannot get the onYouTubeIframeAPIReady to trigger. manifest.json "content_scripts": [ { "matches": ["http://*/*", "https://*/*", "file://*/*", "*://*/*"], "js": ["content-script.js"] } ], content-script.js const appEl = document.createElement('div'); appEl.id = 'my-app'; appEl.innerHTML = `<div id="youtube-iframe"></div>`; const bodyEl = document

youtube video in chrome extension content script

余生颓废 提交于 2019-12-25 13:45:13
问题 I am trying to insert youtube videos with the iframe API in to an existing page with the help of a chrome extension content script. But I cannot get the onYouTubeIframeAPIReady to trigger. manifest.json "content_scripts": [ { "matches": ["http://*/*", "https://*/*", "file://*/*", "*://*/*"], "js": ["content-script.js"] } ], content-script.js const appEl = document.createElement('div'); appEl.id = 'my-app'; appEl.innerHTML = `<div id="youtube-iframe"></div>`; const bodyEl = document

youtube-iframe-api remove suggestion thumbnails at bottom of video

痞子三分冷 提交于 2019-12-25 08:59:11
问题 Could somebody tell me how to remove youtube suggestion thumbnails on embedded video. I am using iframe api. It feel like it should be easy. But i just can't find anything on google on how to do it. tag.src = "https://www.youtube.com/iframe_api"; function initPLayer(playerDivId){ return new YT.Player(playerDivId, { height: '390', width: '640', videoId: '4EDMR75lrKY', events: { 'onReady': onPlayerReady1, 'onStateChange': onPlayerStateChangePlayer1 } }); } Thanks for help! 回答1: I knew it was

Execute JavaScript function when YouTube video is played (using YouTube API)

不打扰是莪最后的温柔 提交于 2019-12-25 05:00:14
问题 I'm embedding a youtube video on my page using the following code: <iframe width="400" height="300" id="newvid" src="http://www.youtube.com/embed/url?modestbranding=1&showinfo=0&feature=player_embedded&fs=0&iv_load_policy=3&rel=0" frameborder="0"></iframe> I'm trying to use the Youtube API, so a javascript function will be executed once user is playing the video, but the following code doesn't work, as I don't see any alert showing when clicking the video: <script src="https://www.youtube.com

ReferenceError: Can't find variable: onPlayerReady (When using callback)

余生长醉 提交于 2019-12-24 21:44:25
问题 I am trying to use onPlayerReady() and onPlayerStateChange() as call backs for my YT Iframe Api wrapper, but I can't seem to reference an instance of my wrapper. How do I go about using the call back to call an instance of my wrapper? I have gotten my code to work when my functions are outside of my wrapper, but I would love to have them inside the wrapper. Error: ReferenceError: Can't find variable: onPlayerReady Player — player.self