youtube-javascript-api

Is it possible to listen for when the chromecast plugin connects with a device for use with the Youtube JS API?

非 Y 不嫁゛ 提交于 2019-12-24 01:44:29
问题 I have a webpage that uses the iframe Youtube player api. I'd like to give the user the ability to Chromecast the currently loaded Youtube video. I've been looking through the Chromecast sender guide. I'm only seeing how to get the session and receiver objects if the user first calls the chrome.cast.requestSession(onRequestSessionSuccess, onLaunchError) function by clicking a button that I create on the page. Is there a way to get the session and receiver objects if they clicked on the

Record how far into a video a user hits the pause button

一个人想着一个人 提交于 2019-12-24 00:43:04
问题 I'm beginning to write a web app that will allow users to annotate embedded YouTube videos with certain events. I'd like the user to be able to pause the video, pull up a menu of candidate events (say, as a modal), and save the selected event along with the associated time in the video that the event occurred to a database. I don't know how to retrieve the time at which the pause button was pressed. I'm assuming that the YouTube API would be the place to go for this, but I've spent about two

iframe www.youtube.com/subscribe_embed? google plus

让人想犯罪 __ 提交于 2019-12-23 01:37:15
问题 I saw this thread Embed Youtube subscribe counter? and I am wondering where does this button come from ? I asked it on that thread but I don't think anyone noticed that I tried some code for myself but this gives a js error Uncaught Error: Bad hint <iframe data-gapiattached="true" frameborder="0" scrolling="no" src="http://www.youtube.com/subscribe_embed?bsv&usegapi=1&channel=HERE CHANNELNAME" style="overflow: hidden; height: 24px; width: 170px; border: 0;"> </iframe> It looks like a plusone

How to catch Youtube player's dragging/skipping/forwarding event with API in javascript

半世苍凉 提交于 2019-12-22 12:44:11
问题 I'm looking at the documentation for onStateChange, but I don't find anything the even when user will be dragging the player timer left or right. In fact, onStateChange doesn't catch anything when I do that. This is from the documentation: https://developers.google.com/youtube/iframe_api_reference This event fires whenever the player's state changes. The data property of the event object that the API passes to your event listener function will specify an integer that corresponds to the new

Uploading a video to youtube from browser

时光总嘲笑我的痴心妄想 提交于 2019-12-22 04:13:18
问题 Im OK authorized. I have 2 button's like this on my page: <input type="file" id="fileToSend"/> <input type="button" onclick="upload()" value="Upload" id="btnSend"/> I want to upload the selected file to youtube when I click the "Upload" button. Im calling a function like this: function upload() { var fileStream; var video = document.getElementById("fileToSend"); var file = video.files[0]; console.log(file); console.log("Nombre: " + file.name); var r = new FileReader(); r.onload = function ()

How to get a youtube playlist thumbnail?

☆樱花仙子☆ 提交于 2019-12-22 04:01:32
问题 Is there a way to get youtube playlist thumbnail like how you can get a thumbnail of a video, explained here: How do I get a YouTube video thumbnail from the YouTube API? 回答1: With the YouTube API v3, you can get the playlist thumbnail using their v3/playlists endpoint and drilling down to items.snippet.thumbnails.high.url For the following playlist: https://www.youtube.com/playlist?list=PL50C17441DA8A565D YouTube's API explorer has a playlist endpoint: https://developers.google.com/youtube

Disable autoplay in youtube javascript api

自闭症网瘾萝莉.ら 提交于 2019-12-22 02:20:55
问题 I know about using autoplay : 0 in params and in url. The problem is when I use the loadVideoByID() function. THe initial video seems to always not autostart. but the moment I load in new video that new one autostarts. I dont want that new one to autostart either $(document).ready(function() { var player; window.onYouTubePlayerAPIReady = function() { player = new YT.Player('player', { height : '390', width : '640', videoId : 'JW5meKfy3fY', playerVars : { 'autoplay' : 0, 'rel' : 0, 'showinfo'

getCurrentTime() for YouTube Video

风格不统一 提交于 2019-12-21 05:07:23
问题 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

AngularJs with iframe

夙愿已清 提交于 2019-12-20 02:42:57
问题 Why this jsfiddle is not working? I am not able to get value of videoId . If I remove ngRoute from module then it is working fine. 回答1: You need to use ng-src like this: <div ng-controller="AppController"> <h1>{{videoID}}</h1> <iframe class="youtube-player" type="text/html" width="auto" height="auto" ng-src="{{videoID}}" allowfullscreen="" frameborder="0"> </iframe> </div> and var app = angular.module('my-app', []); app.controller('AppController', function ($scope, $sce) { $scope.videoID =

AngularJs with iframe

走远了吗. 提交于 2019-12-20 02:42:10
问题 Why this jsfiddle is not working? I am not able to get value of videoId . If I remove ngRoute from module then it is working fine. 回答1: You need to use ng-src like this: <div ng-controller="AppController"> <h1>{{videoID}}</h1> <iframe class="youtube-player" type="text/html" width="auto" height="auto" ng-src="{{videoID}}" allowfullscreen="" frameborder="0"> </iframe> </div> and var app = angular.module('my-app', []); app.controller('AppController', function ($scope, $sce) { $scope.videoID =