youtube-javascript-api

Getting current time of embedded iframe youtube player?

落花浮王杯 提交于 2019-12-19 21:57:46
问题 Here i have tried as follows: HTML <iframe id="player" style="position: relative; height: 220px; width: 400px" src="http://www.youtube.com/embed/7a_CVFRqYv4?rel=0&enablejsapi=1"></iframe> Script var player; function onYouTubePlayerAPIReady() {player = new YT.Player('player');} Here i want to such action like when the player timing reaches 6 seconds,i want to change the src of the iframe. 回答1: This thread describes how you can get the current playing time of a video using the YouTube API

Getting current time of embedded iframe youtube player?

霸气de小男生 提交于 2019-12-19 21:57:30
问题 Here i have tried as follows: HTML <iframe id="player" style="position: relative; height: 220px; width: 400px" src="http://www.youtube.com/embed/7a_CVFRqYv4?rel=0&enablejsapi=1"></iframe> Script var player; function onYouTubePlayerAPIReady() {player = new YT.Player('player');} Here i want to such action like when the player timing reaches 6 seconds,i want to change the src of the iframe. 回答1: This thread describes how you can get the current playing time of a video using the YouTube API

Youtube player JS API seekTo function not working

纵然是瞬间 提交于 2019-12-19 16:35:34
问题 I'm trying to use Youtube chromeless player through the JS API and I'm having problems with seekto() function. The problem is that sometimes (I can't tell when the problem arises), calling seekTo() function backwards to a point in the video that is not loaded don't come back and instead stays in the current time. This is what I do (imagine the video is 240 seconds length): I start playing a video -> loadVideoById(). I move forward to (let's say) the middle of the video -> seekTo(120) Video

Setting video start time with the YouTube API - “start” playerVars option used to work, but now does not?

拟墨画扇 提交于 2019-12-19 11:56:09
问题 I wrote this stupid toy using the YouTube API. Basically it just starts multiple copies of a video at different randomized times. That worked great for like a year. But today I noticed that the randomized start times no longer work, it just starts all of the videos at t=0 (tested on multiple browsers/OSes/computers). Any idea what's wrong? I'm just passing a random number to the start parameter. Seems simple. Here's my code. The key part is in the add function, where the start parameter is

YouTube embed: How to enable *non-muted* autoplay in Chrome for Android

梦想的初衷 提交于 2019-12-19 10:47:51
问题 This question is basically the same as this one which has a solution for HLTML5 videos, except that changing the chrome://flags to set gesture requirement for media playback to disabled has no influence on a YouTube embedded player. I have built a webapp I use to learn music, and loop specific parts of Youtube music videos to learn how to play the song. Here is an example. This works fine on a computer, but using Chrome (59) on Android (7.1.1) I have to tap the video each time it starts again

capturing thumbnail image at specific timeframe from youtube link

*爱你&永不变心* 提交于 2019-12-19 07:59:10
问题 1) is there an API method to capture/store the thumbnail image of the YouTube video at 3:59 which is not the autogenerated thumbnail or the cover thumbnail uploaded by original uploader? There does not seem to be any established answer on SO 2) if (1) is not possible, is it legal for me to download the original video, grab the thumbnails of at the desired timeframe, and use those thumbnails on my app giving credit and attribution to the original source? 回答1: 1) It's not possible with the

Check if YouTube video is live or uploaded

允我心安 提交于 2019-12-19 07:43:47
问题 I have a YouTube Live Event. I am able to play the video using the YouTube IFrame Player API. I want to know if there is any way that I can find if the video is a Live event video or a regular uploaded video. I need this information for designing my controls. 回答1: The only way you can do this (currently) is with youtube backend api. Get data about the video based on its id and in the response you have a property snippet.liveBroadcastContent which is either live, none, or upcoming . 回答2: The

Check if YouTube video is live or uploaded

倾然丶 夕夏残阳落幕 提交于 2019-12-19 07:43:45
问题 I have a YouTube Live Event. I am able to play the video using the YouTube IFrame Player API. I want to know if there is any way that I can find if the video is a Live event video or a regular uploaded video. I need this information for designing my controls. 回答1: The only way you can do this (currently) is with youtube backend api. Get data about the video based on its id and in the response you have a property snippet.liveBroadcastContent which is either live, none, or upcoming . 回答2: The

Youtube API seekTo() in float seconds

允我心安 提交于 2019-12-19 02:54:16
问题 Does the Youtube API seekTo function accept time in float or in frames? Can you drill down up to two decimal places? 回答1: 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

Protecting YouTube v3 API key in a client-side application

元气小坏坏 提交于 2019-12-19 02:26:29
问题 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