
Elevator.js - ozh
http://tholman.com/elevator.js/
======
guptaneil
I know it would ruin the joke, but there should be some notice to turn up your
volume. My speakers were muted, so I didn't realize I was missing anything
until I saw the HN comments.

Definitely made me chuckle once I got the full experience.

~~~
CoryG89
It would be nice if there was a way to check the system audio volume via the
web audio API. Then you could display a notice only if the volume is too low
or too high. Alas, no such functionality currently exists without browser
plugins.

~~~
gdrulia
I would agree that it would be nice to have an option to check if sound is not
muted, but not to actually check the volume.

One of the worst user experiences I have experienced in the recent years is
those notifications telling me that my volume is too loud. But such assumption
most of the time is totally wrong as it is hardware dependent. Especially when
you use additional speakers or headphones with their own volume regulators. On
windows 8.1, every time you make your volume higher than 40%, you will be
interrupted with notification about high volume causing hearing loss, similar
tactics is used in android.

So in my opinion checking system volume to determine whether the sound is too
low or too high is completely wrong approach.

~~~
rtpg
it's hardware dependent, but I was ruining my hearing until I realized that in
fact I don't need to turn up the volume from those notifications. Ears can
work much like eyes do in the dark/quiet and adapt.

I wonder what the potential output volume range for unpowered headphones is
for the volume set at, say, 40% in windows.

~~~
lucaspiller
I have some cheap unpowered Sennheiser headphones, and 20% in Windows is
plenty loud enough for gaming. At full volume I can have them sitting on my
desk and still hear everything clearly :D

~~~
stikypad
Percent of volume says nothing about the line level, which is hardware
specific. Since audio jacks were invented before we had industry standards
bodies, there is no specification that hardware manufacturers have to meet.
Many provide around 1Vpp, or -10dbV, at max volume, but it's going to vary
from device to device. The impedance of the headphones are going to affect the
SPL as well, and none of it is likely calibrated to any high degree of
certainty unless you're buying professional equipment.

------
fredfoobar42
Would be better with "Girl From Ipanema"

~~~
tylermac1
Quintessential elevator music.

------
joemaller1
Though I've used elevators pretty much every day for 20 years, I can't recall
the last time an elevator had music playing.

~~~
gobbert
It's a travesty!

------
tjcelaya
I don't know why there's so much empty space at the bottom but I did notice my
phone allowed me to continue playing the song if I dragged up from the bottom.
It's four full minutes of sweet, relaxing elevator music.

------
n8m
Don't stop re-inventing things! I know there probably are hundreds of those
scripts/plugins out there - but this one made me laugh! Well done!

~~~
nodejsisbest
Amen, brother. Some commenters take life too seriously.

------
arvinsim
There should be a rule that pages that autoplays background music should
explicitly warn the user.

~~~
hardmath123
> This document extends the Web platform with the ability to direct audio
> output to non-default devices, when authorization is given. Authorization is
> necessary because playing audio out of a non-default device may be
> unexpected behavior to the user, and may cause a nuisance. For example,
> suppose a user is in a library or other quiet public place where she is
> using a laptop with system audio directed to a USB headset. Her expectation
> is that the laptop’s audio is private and she will not disturb others. If
> any Web application can direct audio output through arbitrary output
> devices, a mischievous website may play loud audio out of the laptop’s
> external speakers without the user’s consent.

> To prevent these kinds of nuisance scenarios, the user agent must acquire
> the user’s consent to access non-default audio output devices. This would
> prevent the library example outlined earlier, because the application would
> not be authorized to play out audio from the system speakers.

> The default audio output device is always authorized.

:-(

    
    
        [1] http://www.w3.org/TR/audio-output/#privacy-consent (section 5.1)

------
mparramon
Something.js strikes again!

[http://www.developingandstuff.com/2015/03/somethingjs.html](http://www.developingandstuff.com/2015/03/somethingjs.html)

------
taternuts
I have to say, this definitely made me chuckle

------
lifthrasiir
In some browsers (e.g. Chrome), clicking the elevator and leaving the tab to
make it inactive would play the tune indefinitely (the chime plays only when
the tab is activated again). If you enjoyed the tune, well, you've got
something to do now.

~~~
rolfvandekrol
Sadly Tim Holman removed this essential feature:
[https://github.com/tholman/elevator.js/commit/7e19e0f23edf6b...](https://github.com/tholman/elevator.js/commit/7e19e0f23edf6bd78a511539faa5316c2f58d179)

~~~
mintplant
Fortunately you can access the music file directly:
[https://raw.githubusercontent.com/tholman/elevator.js/master...](https://raw.githubusercontent.com/tholman/elevator.js/master/demo/music/elevator-
music.mp3)

------
riscy
Scrolled to the bottom and there was no elevator.

~~~
keehun
Same. I had to turn off my uBlock..

~~~
mappu
It worked correctly for me with uBlock running.

~~~
keehun
You were probably subscribed to different black/white lists.

------
carlesfe
It made me smile :)

In case you missed part of the joke: you need to turn your speakers on

------
malkia
Lol. Can't there be buttons 1..18 for the different levels, and if multiples
are picked, sound on each one, doors opening (short time to read the
paragraph), then another comes.

can't wait to use it now!

~~~
dennisnedry
Making sure to skip the 13th, so it would 1...19.

------
maze-le
That was hilarious. I have hacked something like this a while ago
(autoscrilling from bottom to top), but without the elevator-references, and
the music...

------
hrayr
Hm, I must have gotten a js error because I didn't see an elevator button, and
until I checked HN comments, I had assumed this was a social experiment/joke
to see how far people scroll to find nothing. I tried it couple times, too..

------
drudru11
I made a web page like that a long long time ago.

[http://www.redwoodsoft.com/dru/elevator/](http://www.redwoodsoft.com/dru/elevator/)

The music no longer plays in browsers for some reason.

------
volent
There is a strange behavior on my computer. If I turn the volume up/down when
the music is playing I instantly get to the top of the page !

------
mamoriamohit
I thought this is a useless library, UNTIL I checked out HN comments to find
out that the library played a sound too while scrolling up. :)

------
SchizoDuckie
Brilliant

------
NKCSS
Too bad his name isn't Tim Rolman...

------
amelius
I was already playing music when I pressed that elevator button...

Thanks for the "great" experience :)

------
Jamie452
Well, I wasn't expecting that!

Actually made me laugh a little, nice!

------
ctaglia
I thought it was the old vintage arcade game :-(

------
deitcher
This was a lot of fun. I don't care that it isn't hyper-practical, or a jQuery
plugin may or may not exist. We aren't _that_ serious about ourselves, are we?

------
bdthinh
It doesn't work in Safari.

~~~
hsshah
It worked perfectly for me in Safari (OS X 10.10.3)

Do you have ublock? Try disabling that on this page.

------
naringas
it is very silly.

does that track have a title?

~~~
jffry
[http://www.bensound.com/royalty-free-music/track/the-
elevato...](http://www.bensound.com/royalty-free-music/track/the-elevator-
bossa-nova)

------
danielhgma
Solid chuckle. Two thumbs up

------
melicerte
Excellent !

------
calinet6
Thanks a lot, you woke my girlfriend up.

------
gbachik
Well made sir!

------
soukiab
good work

------
nness
Hilarious!

------
morpheous
Who wrote this a 5 year old?!

I'm very annoyed about the sudden blaring, jarring music. Got a few angry
stares from colleagues.

The polite thing to have done would at least put up a notice.

~~~
danielbln
While I dislike websites playing sudden sounds as much as the next guy, it
should serve as a reminder to keep your computer muted at all times or have a
pair of headphones plugged in when you share office space.

If I ever go postal in the open plan office here, then it's going to be over
random noise (skype sounds being the worst culprit) escaping someone's unmuted
laptop.

~~~
maze-le
> it should serve as a reminder to keep your computer muted at all times or
> have a pair of headphones plugged in

This is so true... I learned it the hard (embarrassing) way.

~~~
zimpenfish
"That awful moment when you're drawing a Powerpuff Girl in the toilets and
your phone decides it should restart Test Match Special. Loud."

------
sparaker
I don't see why you would create a javascript lib for such a simple task,
perhaps a jQuery plugin would have been sufficient. Oh wait, it already
exists. Perhaps you were just bored?

~~~
weavie
Perhaps not everyone uses JQuery.

