youtube-javascript-api

getCurrentTime() for YouTube Video

独自空忆成欢 提交于 2019-12-03 15:11:21
I'm writing a Chrome Extension in Javascript and I want to get the current time for the playing video on youtube.com. I tried using the answer from question Getting Current YouTube Video Time , e.g.: ytplayer = document.getElementById("movie_player"); ytplayer.getCurrentTime(); However I do get following error: "Uncaught TypeError: Cannot read property 'getCurrentTime' of null"; What I am doing wrong? I tried different values for the ElementId - movie_player, player.... Any help is appreciated. Thanks in advance. Cheers. edit: Here is my manifest: { "manifest_version": 2, "name": "",

Adding additional parameters to the yt.player object from youtube

你离开我真会死。 提交于 2019-12-03 13:06:12
I'm initiating a youtube video using yt.player like this: function onYouTubeIframeAPIReady() { player = new YT.Player('player', { height: '720', width: '1280', html5: 0, videoId: 'i8IXMGHpGBk', events: { 'onStateChange': function(e) { if (e.data == 0) { //skrolla här } } } }); } When adding a video using the embed-code, I can add a multitude of other parameters, like these: controls=0&modestbranding=1&showinfo=0&autoplay=1 When i try to add autoplay for example I tried this: function onYouTubeIframeAPIReady() { player = new YT.Player('player', { height: '720', width: '1280', html5: 0, videoId:

How to force high quality thumbnails for YouTube Player API iframe Embeds?

寵の児 提交于 2019-12-03 12:32:51
The thumbnails looked fine for over a year, but suddenly became blurry. The thumbnail that appears on page load looks correct, but anytime a new thumbnail is displayed using 'player.cueVideoById', it looks very blurry. There is no mention in the documentation of how to control the thumbnail quality (only video quality settings, such as 'setPlaybackQuality' are available). The documentation: https://developers.google.com/youtube/iframe_api_reference How can I force high quality thumbnail images? Yes, this issue is easily reproducible. I've created a slightly modified version of the

How to get watched history of youtube user using Youtube Javascript API?

筅森魡賤 提交于 2019-12-03 04:35:17
问题 I am able to get search results, playlists of an user using Youtube Javascript API. How can i get the watched history of an user using Youtube Javascript API??? Is there any Javascript API to get the Youtube watched history of an user?? 回答1: Here's the general procedure: 1) Get the "watch History" playlist of a given user's channel (as a channel ID is the key to getting user info). Note that this will ONLY work when a user is authenticated via oAuth2. https://www.googleapis.com/youtube/v3

Youtube Video Upload using javascript

早过忘川 提交于 2019-12-02 22:42:54
问题 I am trying to make a browser based youtube video uploader using javascript. I am using sample code from here After authentication when I upload video, POST request to youtube server never ends and video is not uploaded. This is happening in the sample provided by google too. Here is the function that i am using to upload video: $('#upload').click(function(){ $('#upload').attr('disabled', true); var title = escapeXmlEntities($('#title').val()); var description = escapeXmlEntities($('

How to get watched history of youtube user using Youtube Javascript API?

此生再无相见时 提交于 2019-12-02 18:34:43
I am able to get search results, playlists of an user using Youtube Javascript API. How can i get the watched history of an user using Youtube Javascript API??? Is there any Javascript API to get the Youtube watched history of an user?? Here's the general procedure: 1) Get the "watch History" playlist of a given user's channel (as a channel ID is the key to getting user info). Note that this will ONLY work when a user is authenticated via oAuth2. https://www.googleapis.com/youtube/v3/channels?part=contentDetails&mine=true&key={YOUR_API_KEY} With that response, there should be a "watchHistory"

Youtube Data Api - Uncaught TypeError: Cannot read property 'setApiKey' of undefined

余生颓废 提交于 2019-12-02 13:05:51
问题 I search music with youtube data api. I use javascript and jquery and i have a problem. Here is my code <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script src="<?php echo SITE_PUBLIC; ?>/bootstrap-3.2.0/dist/js/bootstrap.js"></script> <script src="https://apis.google.com/js/client.js?onload=googleApiClientReady"></script> <script> function keyWordsearch(){ gapi.client.setApiKey('myapikey'); gapi.client.load('youtube', 'v3', function() { data = jQuery.parseJSON( '{

Youtube API - Get notes from videos?

馋奶兔 提交于 2019-12-02 10:54:34
问题 Im using Youtube api v3, I want to get the notes from videos in my playslist for example: The screenshot above is from a playlist I have in my account - I want to get that note for each video in my playlist. Ive hit playlists endpoint: youtube/v3/playlists&part=snippet&playlistId=${ID_HERE}&key=${KEY_HERE} and playlistItems endpoint: youtube/v3/playlistItems&part=snippet&playlistId=${ID_HERE}&key=${KEY_HERE} Neither return the notes in my videos! - Is this possible using this API ? Currently

Youtube API - Get notes from videos?

早过忘川 提交于 2019-12-02 03:54:18
Im using Youtube api v3, I want to get the notes from videos in my playslist for example: The screenshot above is from a playlist I have in my account - I want to get that note for each video in my playlist. Ive hit playlists endpoint: youtube/v3/playlists&part=snippet&playlistId=${ID_HERE}&key=${KEY_HERE} and playlistItems endpoint: youtube/v3/playlistItems&part=snippet&playlistId=${ID_HERE}&key=${KEY_HERE} Neither return the notes in my videos! - Is this possible using this API ? Currently responses look like this: ^ You can see there is no notes property Figured it out: You need to hit:

Get youtube video title in PHP

心不动则不痛 提交于 2019-12-02 02:14:00
问题 In one of my application I am saving youtube video's id... Like "A4fR3sDprOE" .. I have to display its title in application. I got the following code for getting its title and also its working fine. Now the problem is if any error occured ( in case of delete the video ) php showing a error. I hust added a condition. But still its showing error. foreach($videos as $video) { $video_id = $video->videos; if($content=file_get_contents("http://youtube.com/get_video_info?video_id=".$video_id)) {