178 points · by Lightning · 13y ago · 67 comments
While researching this I discovered that you can see audio indicators right now (even in the stable release) by including "–enable-audible-notifications" in the commandline when running the program.
The js basically looks like this: function onPlayerStateChange(event) { var player = event.target; switch (event.data) { case YT.PlayerState.PLAYING: document.title = '▶' + document.title; break; } }
Edit: This is two different bugs. It means that if you are not playing, it will still look like it is playing and if you play multiple times, you will see the symbol get duplicated.
Edit 2: Code should be like this:
var documentTitle = document.title; function onPlayerStateChange(event) { var player = event.target; switch (event.data) { case YT.PlayerState.PLAYING: document.title = '▶' + documentTitle; break; default: document.title = documentTitle } }
but it assumes that the document title doesn't otherwise change.
And to revise my original code, this is what you could use in the PLAYING statement to prevent multiple play symbols: document.title = "\u25B6" + document.title.replace("\u25B6","");
Notice, too, that I replaced the "▶" with the appropriate javascript encoding.
It's coming soon I imagine.
In the case of the commenter below, 100% of his comments are short, and of them most are valueless or negatively valuable.
https://news.ycombinator.com/item?id=6073870
A particularly poignant example.
There are so many pop-unders these days which start talking to you it's unreal.
I'm not a victim of these regularly (thanks to adblock edge) but I know many who are.
I still use WinAmp. Perhaps I'm getting too old for this :)
How do you discover new music?
> Perhaps I'm getting too old for this
Aha, I see
This page wants to play audio, would you like to hear it? Yes / No [V] Remember for the next times
The funny thing is that soundcloud and youtube behave very well in this respect. Apparently the biggest audio sites (just look at the amount of music on youtube!) don't need to start blasting without any user interaction.
I have two issues, one is some news websites that autoplay videos on random parts of the page.
The other, more annoying, is video websites (for example to watch fansubbed anime) that have ads that the ad author (not the side) somehow hidden it... Once I even found it, opening the inspector and looking around, but sometimes a page is ridicously complex that it is easy to just close it, and find another site.
Sadly that wasn't the case.