youtube-javascript-api

Why YouTube JavaScript Player API open a different URL than the one in my code, and just play the first video of a playlist?

喜欢而已 提交于 2019-12-01 12:14:59
问题 It is my first post, I hope I respected all the rules. I am trying to publish on a page of my website a: shuffle / muted / autoplay youtube playlist. I used the method AS3, with SWFObject. Everything worked fine with the following code, but since few weeks, the player doesn't detect my playlist and just play the first video. In the code, the URL is : https://www.youtube.com/v/HuIGf4IJzdM& list=PLo -QIlIZx6myBxEysxrWoE-f58-psKGji But when I open the page of the page, it open the following link

Can you derive a Hangout On Air join URL from the YouTube Live Streaming API?

老子叫甜甜 提交于 2019-12-01 10:49:35
问题 As the Google+ Hangouts API has shut down, how can I use the YouTube Live Streaming API to: Show me that a Hangout I started is broadcasting (I guess because it's broadcasting to YouTube) Get the join URL for the Hangout on Air (the one that I hand out to others so they can join)?... or at least derive it from something that the API gives me? 来源: https://stackoverflow.com/questions/50605116/can-you-derive-a-hangout-on-air-join-url-from-the-youtube-live-streaming-api

Can not insert multiple videos into a playlist - YouTube API v3

谁说我不能喝 提交于 2019-12-01 07:39:05
I am trying to add multiple videos to a playlist, but only one video is added to the playlist. I can successful create a playlist and insert a video to the playlist, but can not insert multiple videos to the playlist. Below is a simple way that I am doing this. The function addTheseVideosToPlaylist() is specifically where I am failing. createPlaylist() and addToPlaylist() are also shown. There is a global playlistId to keep track of created playlist. var playlistId I create a playlist like this: function createPlaylist() { var request = gapi.client.youtube.playlists.insert({ part: 'snippet

Can not insert multiple videos into a playlist - YouTube API v3

好久不见. 提交于 2019-12-01 04:20:37
问题 I am trying to add multiple videos to a playlist, but only one video is added to the playlist. I can successful create a playlist and insert a video to the playlist, but can not insert multiple videos to the playlist. Below is a simple way that I am doing this. The function addTheseVideosToPlaylist() is specifically where I am failing. createPlaylist() and addToPlaylist() are also shown. There is a global playlistId to keep track of created playlist. var playlistId I create a playlist like

addEventListener in content script not working

孤者浪人 提交于 2019-12-01 04:11:12
I've got a chrome extension with a popup.html and an injected content script. With the injected content script I'm trying to access youtube's javascript API functions and it all works fine except for one: addEventListener. The event listener of Youtube's javascript API listens for the state of the video to change. So if the end of the video is reached the state changes to 0. var currentVideo = document.getElementById('movie_player'); currentVideo.addEventListener("onStateChange", "onytplayerStateChange"); function onytplayerStateChange() { console.log("The state of the player has changed"); }

Youtube API seekTo() in float seconds

强颜欢笑 提交于 2019-11-30 21:07:57
Does the Youtube API seekTo function accept time in float or in frames? Can you drill down up to two decimal places? Yes, the API accepts seekTo time in float perfectly; it will advance to the closest keyframe before your float, whatever that may be. Here's a demonstration: http://goo.gl/E4jzu Seeking to a frame is a little trickier of a beast, as different videos have different fps rates. Since you can't get the fps via the API (unless there's a method I don't know?), it would be too difficult to try to write a wrapper that could convert the frame you want to seek to into a float. If they are

Protecting YouTube v3 API key in a client-side application

。_饼干妹妹 提交于 2019-11-30 20:19:14
I'm looking at the following guide: https://developers.google.com/youtube/v3/getting-started The first step of interacting with YouTube's API is: You need a Google Account to access the Google Developers Console, request an API key, and register your application. And they continue on to show an example where they use the key: URL: https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=YOUR_API_KEY &part=snippet,contentDetails,statistics,status I have a client-side application which is used by many people. The application issues search requests to YouTube's API. YouTube's API has a

Detect if browser supports autoplay of embedded media - YouTube playVideo() and iOS

拟墨画扇 提交于 2019-11-30 19:40:00
What's the best way to detect if a browser supports autoplay of embedded media files? Using the youtube javascript API, on iOS (and possibly Android) devices, if you call playVideo() prior to the user tapping on the video, the video is put in a bad state and is basically useless. You might do this when you want to autoplay the video after the page loads, or you might have your own play/pause button. There are lots of discussions on how to get autoplay to work (see below), but another way to deal with this is to detect when it shouldn't be called. The obvious answer would be to detect a

Youtube player api with loop

风格不统一 提交于 2019-11-30 14:41:48
问题 I am struggling with setting up the loop for youtube videos using youtube player api. The problem is that the video is not running under a loop. Here is my code var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubeIframeAPIReady() { player = new YT.Player('player', { height: '390', width: '640',

Youtube player api with loop

五迷三道 提交于 2019-11-30 11:16:21
I am struggling with setting up the loop for youtube videos using youtube player api. The problem is that the video is not running under a loop. Here is my code var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubeIframeAPIReady() { player = new YT.Player('player', { height: '390', width: '640', playerVars: { 'controls': 0, 'showinfo': 0, 'rel': 0, 'loop': 1 }, videoId: 'qzZuBWMnS08', events: {