altering the real world
with JavaScript
Jan Jongboom
JSConf.US 2015
Telenor R&D
@janjongboom
Mozilla
We're on the verge of a
new era
alert('Hello ' + prompt('Your name?'))
take code into the
real world
JUST
the revolution is
getting started
Audience participation!
and GIFs!
Computer generated
music
http://gibber.mat.ucsb.edu/
1 a = Drums('x*o*x*o-')
Gibber
Gibber
1 a = Drums('x*o*x*o-')
2 a.pitch = 0.5
Gibber
1 a = Drums('x*o*x*o-')
2
3 speak = Speak({ pitch: 70, wordgap:5 })
4 .say.seq(
5 ['J', 'S', 'Conf'],
6 [1/4, 1/4, 1/4, 1/2].rnd()
7 )
8
9 speak.pitch.seq( [1,.8,1.2].rnd() )
10 Clock.bpm = 120;
Gibber
1 a = Drums('x*o*x*o-')
2
3 speak = Speak({ pitch: 70, wordgap:5 })
4 .say.seq(
5 ['J', 'S', 'Conf'],
6 [1/4, 1/4, 1/4, 1/2].rnd()
7 )
8
9 speak.pitch.seq( [1,.8,1.2].rnd() )
10 Clock.bpm = 120;
So much phones!
Go to http://192.168.158.139:9321
Gibber
(JSConf2015_Track_A)
Gibber
1 a = Drums('x*o*x*o-')
2 a.pitch = Phone.X
https://github.com/janjongboom/jsconf-us/blob/master/gibber/gibber-phone.js
Go to http://192.168.158.139:9321
Getting data out of the
real world
Bluetooth beacons
Broadcasting their existence
Bluetooth beacons
Long battery life
Cheap
URLs, sensor values, etc.
Coming to a web browser near you
https://bugzilla.mozilla.org/show_bug.cgi?id=1063444
Scanning beacons
1 var adapter = navigator.mozBluetooth.defaultAdapter
2 adapter.startLeScan([]).then(handle => {
3 handle.ondevicefound = e => {
4 // handle e.scanRecord
5 }
6
7 setTimeout(() => {
8 adapter.stopLeScan(handle)
9 }, 5000)
10 }, err => console.error(err))
JavaScript baby monitor
Tag your baby with a phone
Get three beacons
Some math
http://janos.io
DEMO TIME
http://192.168.159:139:9321
One more thing...
Firefox OS is
not just about
phones
BLE, VR, WebCL
Wearable
Augmenting reality
Hyperlocal services
Open standards
mozilla
glass
mozilla glass
Works with any glasses
No extra device required
Voice controlled
Self build kit ~$300
Camera module
Display & sensors
WebRTC
Mirror
We can't predict the future
(It's 2015, where's my hoverboard?!)
THANK YOU!
@janjongboom
github.com/janjongboom/jsconf-us

Altering the real world with JavaScript - JSConf.US 2015