youtube-javascript-api

Is it possible to hide youtube's big red play button with a parameter?

烂漫一生 提交于 2019-11-29 09:17:33
Quick example of the code I'm using at the moment to create my YouTube iframe: player = new YT.Player('[PLAYER ID]', { height: '300', width: '480', videoId: '[VIDEO ID]', playerVars: { 'controls': 0, 'showinfo': 0 }, }); It's all working great so far, it's loading the video fine without controls or the info strip and I'm 'manually' playing the video using javascript. The problem is that there's now no need for the big red 'play' button that is momentarily displayed as the video's starting. Is there any way I can get rid of this? I've looked through the documentation and can't find a suitable

Javascript core crash when using YouTube iframe player in UIWebView in iOS 11.3

两盒软妹~` 提交于 2019-11-29 03:56:38
问题 We have an iOS app with a UIWebView that loads YouTube iframe player to play youtube videos. After iOS 11.3 released we found that there are a lot of javascript core crashes. On Fabric crashlytics the crash stcktrace looks like this Crashed: WebThread 0 JavaScriptCore 0x18aa48298 JSC::JSLock::DropAllLocks::DropAllLocks(JSC::VM&) + 176 1 JavaScriptCore 0x18aa4826c JSC::JSLock::DropAllLocks::DropAllLocks(JSC::VM&) + 132 2 WebCore 0x18b78b794 SendDelegateMessage(NSInvocation*) + 360 3

How to embed youtube videos as playlist [closed]

▼魔方 西西 提交于 2019-11-29 01:08:26
问题 I have numerous youtube video clips, and I was wondering if it is possible to embed them on the site as youtube playlist, so that the next video starts playing automatically once the clip finishes. Is there such functionality either with YouTube API or without. If not possible, what would be the best approach. Thanks in advance. 回答1: Actually there are two ways to embed playlists from youtube. In the first method you can directly specify all the videos that you want to play in the embed

Start youtube video on hover/mouseover

Deadly 提交于 2019-11-29 00:43:56
I'm trying to get youtube videos to start on hover. It will pause (not stop) when the user hovers over another video... I am stuck on the hover command. Can someone help me work it out please? The page has 16 videos, this is the working code from the jsfiddle that contains 3 videos as an example. http://jsfiddle.net/sebwhite/gpJN4/ VIDEO: <iframe id="player" width="385" height="230" src="http://www.youtube.com/embed/erDxb4IkgjM?rel=0&wmode=Opaque&enablejsapi=1;showinfo=0;controls=0" frameborder="0" allowfullscreen></iframe> JAVASCRIPT: function onYouTubeIframeAPIReady() { player = new YT

javascript / youtube api - variable YT is not defined

喜你入骨 提交于 2019-11-29 00:03:02
I'm creating a youtube player embed via the YT api but I keep getting an alert that the variable YT is not defined. I can see that the script for the youtube API is getting included, which is supposed to create the variable YT - so why isn't this working? It works elsewhere on my site. Here's the link: http://oncreativity.tv/site/single/4/7CtQaTmEuWk and my code: <script> $(document).ready(function() { var tag = document.createElement('script'); tag.src = "http://www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore

Hide/show in JavaScript - stop playing YouTube iframe video [closed]

这一生的挚爱 提交于 2019-11-28 22:54:38
问题 I've used the iframe function to embed videos, and I'm hiding/showing the content and videos through JavaScript. I have one problem. When I press play on the first video, and then click on the next without stopping the first one, the first one just keeps on playing. What can I do to stop the video in the "background", when showing new content? $(function(){ $("#link1").click(show1); }); function show1(){ $("#pic1").fadeIn(); $("#pic2").hide(); } I'm just using this simple JavaScript function,

Why isn't the YouTube iframe player calling onYouTubePlayerReady when it's loaded?

丶灬走出姿态 提交于 2019-11-28 12:39:25
I want to load a YouTube video, then mute, play, pause, and unmute it immediately. In doing this, I hope to present the user with a video that doesn't have a big play button on it, and does have the controls on the bottom. In order to do this, I have the following code: <script type="text/javascript"> function onYouTubePlayerReady(playerid) { mutePlayPauseUnmute(playerid); } function onYouTubePlayerAPIReady(playerid) { mutePlayPauseUnmute(playerid); } function onYouTubeIframeAPIReady(playerid) { mutePlayPauseUnmute(playerid) } function onPlayerReady(playerid) { mutePlayPauseUnmute(playerid) }

YouTube Player API: retrieving a reference to an existing player

我只是一个虾纸丫 提交于 2019-11-28 06:41:27
问题 I'm developping a Google Chrome extension, using content script. I want to interact with pages embedding a YouTube video player. I have include the www-widgetapi-vfljlXsRD.js as a JavaScript file, and YouTube namespace is correctly initialize inside the extension sandbox. I'm trying to retrieve a reference to an existing iFrame player. To achieve that, I tried this: var ytplayer = new YT.Player('ytplayer'); ytplayer.pauseVideo(); where div#ytplayer is the iFrame embedding the actual player. I

Retrieving individual videos view count - Youtube API V3.0 - JavaScript

强颜欢笑 提交于 2019-11-28 06:27:22
I've been trying to get the view count on videos that I query through the following method: function search() { var request = gapi.client.youtube.search.list({ part: 'snippet', channelId: 'IRRELEVANT', order: 'date', maxResults: '25' }); request.execute(function(response){ YoutubeResponse(response); }); While the documentation tells me that there's a statistics portion to every video, after the snippet I have __proto__ which I guess means there was an error somewhere? or did the API change? Essentially I need the view count of those 25 most recent videos... I tried changing part: 'snippet' to

YouTube Player API: How to get duration of a loaded/cued video without playing it?

故事扮演 提交于 2019-11-28 05:06:05
I'm not able to get the correct video duration/length (in seconds) of a loaded/cued video via the getDuration() method of the YouTube Player API; the same method, however, returns a valid value once the video starts playing! Wondering how YouTube is able to show the valid duration of a loaded/cued video. When I load this HTML page with a 15 second video clip, I get the following debug output: state = 5 duration = -0.000025 When I hit the Play button, I get the following debug output: state = 3 duration = 15, Would greatly appreciate a solution or a workaround. Loading, and immediately playing