Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Glow feature not working. #532

Closed
ChromeCanary opened this issue Jun 15, 2014 · 3 comments
Closed

Glow feature not working. #532

ChromeCanary opened this issue Jun 15, 2014 · 3 comments

Comments

@ChromeCanary
Copy link

Change: 7aaa69d

I'm not sure how this feature should work, I think it should work like Philips Ambilight TV where it takes the picture color from TV screen and then shows it outside of the TV screen in real time. Like this:

ambilight-3

This should work only when Lights Off is also enabled? I tested this feature and it won't work.

I have Chrome Canary v37 x64 and YTCD v310.

@YePpHa
Copy link
Owner

YePpHa commented Jun 15, 2014

The Player Glow feature takes the average color of the video and makes a glow around the player with the average color. The Lights off is currently in front of the glow and therefore it can't be seen when the Lights off feature has been enabled. I might make an option to change this so it can be shown when the Lights off feature is enabled.

I should also say that this feature only works in certain conditions. First and foremost you have to use the HTML5 player otherwise YouTube Center can't access the video data (it uses HTML5 to do this trick). Another is that the DASH playback has to be enabled, because otherwise Chrome (and other browsers) will prevent YouTube Center from accessing the current video frame data (see https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image). The DASH playback stream is converted to a special kind of URL on Chrome that has the same domain as the page you're on whereas the non-DASH URL is on another domain.
The third is that it's only Chrome that handles the DASH stream as the same domain/origin as the page you're on. The feature does not work on Firefox as Firefox handles the DASH stream differently and therefore the URL isn't on the same domain. I don't know if this is the case for Safari and other browsers.

So this feature currently only works on Chrome with the HTML5 player and DASH playback turned on. As far as I know it would not be possible to make a workaround for these issues.

EDIT: I did these tests with the current stable version of Chrome so I have no idea if Google have changed something in the canary channel.

@YePpHa
Copy link
Owner

YePpHa commented Jun 15, 2014

Here's a snippet from the code where true = checked and false = not checked. The numbers are as they appear in the settings.

playerGlowEnabled: false,
playerGlowPixelInterval: 100,
playerGlowRequestAnimationFrame: true,
playerGlowUpdateInterval: 20,
playerGlowTransition: 0,
playerGlowBlur: 15,
playerGlowSpread: 5,
playerGlowOpacity: 75,

@YePpHa
Copy link
Owner

YePpHa commented Jun 15, 2014

I should also note that the lower the Pixel interval is, the better average color it calculates to a minimum of 1 (at 1 it uses every pixel where at 100 it uses every 100th pixel). If you disable the Request animation frame option it will update the average color every nth millisecond of the Update interval option.

Here's the description of every option I sent to one of my translators:

"Pixel inteval" -> iterate every nth pixel instead of every single pixel
"Use request animation frame" -> It will use the (https://developer.mozilla.org/en/docs/Web/API/window.requestAnimationFrame) to call itself otherwise it will use setTimeout (see "Interval").
"Inteval" -> It will call itself every nth millisecond using setTimeout (except when using "Use request animation frame").
"Transition" -> The amount of milliseconds it takes to transition to another color.
"Blur" -> The amount of blur of the glow.
"Spread" -> How many pixel the glow will spread from the player.
"Opacity" -> The opacity of the glow

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants