youtube-javascript-api

Youtube iframe player won't show videos in android 4.x WebView

二次信任 提交于 2019-11-28 03:42:36
问题 I'm trying to use the youtube iframe player inside an android WebView but it fails on android 4.x while on 5.x everything works great. When I try it in 4.x the player loads the video, when I start it I see nothing but hear the video sound. The logcat gets filled with chromium error messages over and over again: E/chromium(20362): [ERROR:gles2_cmd_decoder.cc(5942)] [.Compositor-Onscreen-0x5db83bb8]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked E/chromium(20362): [ERROR:gles2

YouTube API - Loop video between set start and end times

我怕爱的太早我们不能终老 提交于 2019-11-28 03:41:52
问题 I've managed to start the video and end the video at the times I need, but is there any way to loop this? The loop option doesn't seem to be doing much. Fiddle: https://jsfiddle.net/u7nkz292/ Code: <div id="ytplayer"></div> <script> // Load the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = "https://www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag,

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

∥☆過路亽.° 提交于 2019-11-28 03:03:30
问题 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

gapi.client.youtube is undefined?

怎甘沉沦 提交于 2019-11-27 23:21:03
I am trying to use youtube api for javascript and am getting 'gapi.client.youtube is undefined'. I have gone through the link: Why is 'gapi.client.youtube' from Youtube Data Api V3 undefined? , but couldn't get much help. My code is placed below: <script> function load(){ gapi.client.setApiKey('AIzaSyARvwirFktEIi_BTaKcCi9Ja-m3IEJYIRk'); gapi.client.load('youtube', 'v3'); searchA(); //alert(gapi.client.youtube.channels); } function searchA() { var q = 'pink floyd'; var request = gapi.client.youtube.channels.list({ part: 'statistics', forUsername : 'GameSprout' }); request.execute(function

YouTube API Target (multiple) existing iframe(s)

故事扮演 提交于 2019-11-27 17:54:15
I'm trying to understand how to target an existing iframe using the YouTube API (i.e. without constructing an iframe with the script). As usual, Google does not give enough API examples, but explains that it IS possible, here http://code.google.com/apis/youtube/iframe_api_reference.html Here is an example of what I'm trying to do - the video underneath the thumbnail should play. I am almost there, but only the first video plays... http://jsfiddle.net/SparrwHawk/KtbYR/2/ Rob W TL;DR: DEMO: http://jsfiddle.net/KtbYR/5/ YT_ready , getFrameID and onYouTubePlayerAPIReady are functions as defined in

javascript / youtube api - variable YT is not defined

自古美人都是妖i 提交于 2019-11-27 15:14:01
问题 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";

Pause YouTube iframe embed when playing another

可紊 提交于 2019-11-27 14:10:49
I have multiple YouTube iFrames embedded on a page. If one of the movies is already playing, and a user then decides to start playing a different movie, is it possible to stop playing the first movie so there is only ever one playing at a time? I have looked at the 'YouTube Player API Reference for iframe Embeds' https://developers.google.com/youtube/iframe_api_reference but if i'm honest I just don't understand it. My developer skills are very limited.... clearly. Pitiful I know, but this is all I have at the moment (just the iFrames)... http://jsfiddle.net/YGMUJ/ <iframe width="520" height=

Pause youtube video, youtube api

爱⌒轻易说出口 提交于 2019-11-27 13:20:32
I'm trying to pause and play YouTube videos with the following code which is pretty much a copy from the Youtube API page : // 2. This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = "http://www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); // 3. This function creates an <iframe> (and YouTube player) // after the API code downloads. var player; function onYouTubePlayerAPIReady() { player = new YT.Player('player', { height: '315',

How to get the mp4 url for Youtube videos using Youtube v3 API

天涯浪子 提交于 2019-11-27 11:29:38
How do I get the full mp4 url to play the video from it's actual location in my application using some other source except Youtube. The gdata/youtube API has been deprecated so I am having trouble. Any help will be appreciated. Thanks. i made a very simple API : https://gist.github.com/el3zahaby/9e60f1ae3168c38cc0f0054c15cd6a83 As Example: YouTube Video Link: https://www.youtube.com/watch?v= YGCLs9Bt_KY now to get the Direct link you need to call the api , like this : https://script-url.com/?url=https://www.youtube.com/watch?v=YGCLs9Bt_KY returns: [ { "url": "https:\/\/r10---sn-aigllnlr

Embed YouTube Video with No Ads

ぃ、小莉子 提交于 2019-11-27 07:45:45
I'm embedding YouTube videos in a widget (http://www.betterdonatebutton.com) to help non-profits raise money. Unfortunately, some of them are not technically inclined enough to turn off ads that display over their videos. How do I embed a YouTube video and specify that I prefer no ads to be displayed? Jeff Posnick Whether ads are shown on a video is up to the content owner of that video. It's not something that the embedder can control. If you had permission from the content owners of the videos to upload copies in your own account, and then ensured that your account was set up with