youtube-javascript-api

Youtube “Blocked a frame with origin ”http://www.youtube.com“ from accessing a frame with origin” even if the same protocol is used

自闭症网瘾萝莉.ら 提交于 2019-12-09 07:43:23
问题 When embedding a Youtube playlist I am getting this error: Blocked a frame with origin "http://www.youtube.com" from accessing a frame with origin "http://www.mydomain.com". Protocols, domains, and ports must match. I am not mixing HTTP with HTTPS anywhere, so I don't know why I am getting this error in the first place. I have noticed that recently the Youtube embedded playlist is not displaying the embed image of the first video and just displaying a black screen with a 'Play All' button,

Youtube Subscribe Button Event

不打扰是莪最后的温柔 提交于 2019-12-08 05:26:47
问题 How can I catch an event when a user subscribes to my Youtube Channel on my site? 回答1: You could use an image, button, or banner in order to record the action(click) that lands them on the YouTube subscription page. <p> <a href="DOMAIN" onClick="_gaq.push(['_trackEvent', 'ChannelSubcription', 'SUBSCRIBED', 'SUBSCRIPTION');"><img src="Title.jpg"></a></p> If you're trying to record the action from an embedded player you'll need to use YouTube's API - it would be wise to reference their beta API

Can't Figure Out How to Pause YouTube Video on Click

守給你的承諾、 提交于 2019-12-07 23:47:36
问题 My users are using the old embed method of utilizing the tag YouTube gives you instead of the iframe. I'm trying to figure out how to detect the player state (when it's paused, playing etc) when a user interacts with it so I can pause the video when the user clicks to the next slide. Currently using Wordpress I have a metabox that allows them to paste in the YouTube embed code and then I output that block of code onto the slider. I'm working on my localhost (example: http://mysite.dev).

How to remove black bar from the YouTube videos

眉间皱痕 提交于 2019-12-07 21:48:59
问题 The black bar appears in the YouTube video, it looks little odd when the video plays. Can we remove that black space from the videos? I want to remove that black space and shows the video at desire aspect ratio as the we choose for the player size. For now I am using the stander google YT player API. Is it make any sense? 回答1: This is what you want -- while you have to customize a bit more; it achieves the functionality you desire 回答2: Try the chromeless player. You can develop your own

YouTube Player API: getDuration(), getCurrentTime(), getVideoData() not working

僤鯓⒐⒋嵵緔 提交于 2019-12-07 19:46:07
问题 For my application, I am trying to use the YouTube Iframe player API to play videos, and allow the user to change videos without reloading the page. I accomplish this by using the player.loadVideoById(video_id) method. After loading the video via YouTube video id, I also want to capture all relevant information about the video. However, I notice that none of the get functions work right away, including getDuration() , getCurrentTime() and getVideoData() . I have found a scrappy solution of

YouTube IFrame API doesn't always load?

落爺英雄遲暮 提交于 2019-12-07 18:04:44
问题 I've seen lots of similar questions to this, but I believe this is different. When I try to define onYouTubeIframeAPIReady in the global scope, the function only gets called about half the times I load the page (if I keep refreshing, sometimes I'll see the console message, and sometimes it isn't there). It's confusing to me that this only happens sometimes, and I don't call onYouTubeIframeAPIReady anywhere else in my code. Problem areas I've checked: I'm running it on Github Pages (so it's

Retrieve player state with multiple youtube players on a page

人走茶凉 提交于 2019-12-07 11:59:28
问题 I hava a single HTML with many youtube players. I'm suscribing to the onStateChange to get notified when the user plays a video. function onYouTubePlayerReady(playerid) { var player = document.getElementById("playerA"); player.addEventListener("onStateChange", "callback"); } Now the callback get the newState as parameter. function callback(newState) { ... } This works ok with only one player. But with many players, how can I know wich player raised the StateChange event? Callback just have

Youtube iframe API, subscribing to events

微笑、不失礼 提交于 2019-12-06 17:04:34
问题 YouTube iframe API: how do I control a iframe player that's already in the HTML? How do I subscribe to events here? I would like to listen for video finish. 回答1: Have a look at my function as defined at this answer: Listening for Youtube Event in JavaScript or jQuery . In your case, implement the core functions as shown below ( Fiddle: http://jsfiddle.net/w2w5x/ ) // Core functions defined at https://stackoverflow.com/q/7988536#7988536 var player; YT_ready(function(){ var frameID = getFrameID

firefox addon sdk - how to retrieve “currentTime” from youtube player on youtube.com?

試著忘記壹切 提交于 2019-12-06 13:29:46
问题 I am developing a firefox addon with SDK. What I want to do: If user is on a video of youtube the firefox addon knows the current position of youtube player (getCurrentTime()) I developed it with tabs var tabs = require("sdk/tabs"); and when tab is ready, I added contentscripfiles to it with: tabs.activeTab.attach({ contentScriptFile: [data.url("jquery-1.11.1.min.js"), data.url("myscript.js")] }); In the script "myscript.js" I want to access to the youtube player on the youtube site. I tried

I can't play youtube chromeless player on chrome extension

ⅰ亾dé卋堺 提交于 2019-12-06 12:19:04
问题 I'm newbie at chrome extension. I'm making chrome extension that play youtube chromeless player. It worked on chrome web browser. But, it isn't working on chrome extension. I tested local .swf file. That is worked on chrome extension. I think, chrome extension can't call onYouTubePlayerReady() . So I called window.onYouTubePlayerReady() after swfobject.embedSWF() . But, it isn't worked at ytplayer.loadVideoById("xa8TBfPw3u0", 0); with error message. The error message was Uncaught TypeError: