youtube-javascript-api

How to get YouTube autoplay to work in UIWebView?

China☆狼群 提交于 2019-12-18 18:36:12
问题 Platform: iOS 6.1. Xcode 4.6. I am using YouTube Javascript API and a UIWebView. I am able to manually tap on the video thumbnail to begin playback just fine. But, autoplay is not working. I am setting mediaPlaybackRequiresUserAction = NO for the web view as many have suggested. No luck. Here is the code: @interface VideoPlayerController : UIViewController <UIWebViewDelegate> @property(strong, nonatomic) IBOutlet UIWebView* webView; @end - (void) viewDidLoad { [super viewDidLoad]; self

YouTube signature decipher with an working example for VB.Net

北城以北 提交于 2019-12-18 10:57:22
问题 I know there are many projects and I could use them. But I really want to get it running without dependencies in my VB.Net project. So what I try to do is creating a Youtube downloader . It works great on usual videos. But these special videos like Vevo (https://www.youtube.com/watch?v=9bZkp7q19f0) and some others do not work. They have another signature that I need to decipher. Here I need the HTMLPlayer JS file which I was able to extract(http://s.ytimg.com/yts/jsbin/html5player-de_DE

Youtube iframe player JS API with jQuery - player object has no method 'getPlayerState'

淺唱寂寞╮ 提交于 2019-12-18 07:23:25
问题 I've got following code, that is suppose to pause Slidedeck's autoscroll whenever there is a mouseover event. For mouseout event, the autoscroll should resume working unless the youtobe video in the Slidedeck is currently playing or buffering. I got it working fine if there wasn't the condition for the Youtube video. I believe there's a problem with the scope for the object player, but can't work it out, how to fix this problem. The error I get in console on mouseout is: Uncaught TypeError:

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

若如初见. 提交于 2019-12-17 17:46:07
问题 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 =

Pause youtube video, youtube api

那年仲夏 提交于 2019-12-17 10:49:43
问题 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

Getting Error 403: Access Not Configured. Please use Google Developers Console to activate the API for your project

醉酒当歌 提交于 2019-12-17 02:22:43
问题 I am trying to use the Youtube API to pull in all the videos from a particular channel. I set up the project in Google Developers Console and got an API browser key. I enabled YouTube Data API v3 and for safe measure, I enabled YouTube Analytics API. I do not know what I am getting this error. Can anyone help me. { "error": { "errors": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured. Please use Google Developers Console to activate the API for

How to pause a YouTube player when hiding the iframe?

妖精的绣舞 提交于 2019-12-17 01:39:37
问题 I have a hidden div containing a YouTube video in an <iframe> . When the user clicks on a link, this div becomes visible, the user should then be able to play the video. When the user closes the panel, the video should stop playback. How can I achieve this? Code: <!-- link to open popupVid --> <p><a href="javascript:;" onClick="document.getElementById('popupVid').style.display='';">Click here</a> to see my presenting showreel, to give you an idea of my style - usually described as

YouTube iframe API: how do I control a iframe player that's already in the HTML?

余生颓废 提交于 2019-12-16 19:52:50
问题 I want to be able to control iframe based YouTube players. This players will be already in the HTML, but I want to control them via the JavaScript API. I've been reading the documentation for the iframe API which explain how to add a new video to the page with the API, and then control it with the YouTube player functions: var player; function onYouTubePlayerAPIReady() { player = new YT.Player('container', { height: '390', width: '640', videoId: 'u1zgFlCw8Aw', events: { 'onReady':

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

Stop Youtube player in IE7 (using Rob W solution)

感情迁移 提交于 2019-12-13 07:08:12
问题 I'm using this script made by Rob W and everything works fine except for IE7. Here it is the jsfiddle page. I've also tried importing this to enable JSON on IE, but it still doesn't work on IE7. There is a way to solve this problem? 回答1: Unfortunately, there is no way to solve this problem (except for upgrading browser), because IE7 does not support the postMessage method. This method is required, because it's the only way to communicate with the embedded YouTube frame. postMessage on frames