News for hackers. Stuff that matters.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by hebejebelus on Monday March 19, 2012 @12:32PM (#3724640)
I worked on a project[0] very similar to this just recently. It's definitely not as nice as this, but it's got the added advantage of being able to use javascript events to-spec, and the only lines in your game code are these:

    iPhone = new Controller();
    iPhone.on('touchstart', function(event) { /*...*/ }
That's the entire API ;)

I'm in two minds over the use of QR codes here. I had two solutions to the problem of pairing browsers: as I do it now, I ask for a pairing code. Another, more hacky (but possibly nicer) solution is to assume that if a controller and a parent browser have the same external IP, you can assume that they want to pair up.

Anyway, kudos to the developers - it's a really cool idea, I think. If my code can help out at all, please go right ahead :) (also sorry for hijacking your thread)

[0] https://github.com/CarlQLange/Controller.js

Re:Use your iPhone/iPad as a controller for an HTML5 browser... by wowfat on Monday March 19, 2012 @12:24PM (#3724606)
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by trip42 on Monday March 19, 2012 @02:56PM (#3725531)
I built a slideshow control system for a class project using nearly the same approach. A user uploads a slideshow or authors it online and connects a phone/device via a QR Code or URL to control the presentation. The controller uses websockets to communicate with a nodejs server for events like previous/next, a touch-screen based laser pointer, and presenter notes. I was amazed how responsive the touch movements translated to moving a dot on the screen through a remote node server.

We didn't use any accelerometer events, but touch events worked seamlessly on iOS and Android.

Re:Use your iPhone/iPad as a controller for an HTML5 browser... by endergen on Monday March 19, 2012 @03:55PM (#3725858)
We're doing the same thing at Brass Monkey, raised our seed round and are trucking along with lots of features. Hope you guys check us out to. Checkout our website and video demo. http://playbrassmonkey.com/
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by Mondain on Monday March 19, 2012 @04:02PM (#3725899)
It should be noted that we don't rely solely on HTML5 and nor do our device implementations. :)
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by endergen on Monday March 19, 2012 @04:14PM (#3725957)
True dat. We require a Controller app to be downloaded. But then we have auto-pairing tech. We have more than just HTML5 game support. But Flash and Unity Webplayer games as well.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by seventyfishes on Monday March 19, 2012 @01:31PM (#3725033)
This is a pretty similar idea to what the guys at Clik are doing.

http://demos.clikthis.com/ethershock/

I think they have an Android/iPhone companion app that works for these types of web apps.

Re:Use your iPhone/iPad as a controller for an HTML5 browser... by taitems on Monday March 19, 2012 @07:42PM (#3726972)
Hmm, that just 404s when scanned.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by KHPatel on Monday March 19, 2012 @08:13PM (#3727096)
+1. 404'd
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by suhastech on Monday March 19, 2012 @01:27PM (#3725001)
I had worked on a similar weekend project where you control an actual toy car with the iPad. (I'll probably blog about it soon)

I solved the latency problem by using websockets. I know, it's not a widely used standard but was good enough for a weekend project.

Re:Use your iPhone/iPad as a controller for an HTML5 browser... by jaylin on Tuesday March 20, 2012 @03:07PM (#3730953)
I have been working on this similar idea for more than a year now. Really glad seeing more people are interested in this. Ping me if you are interested in chatting a little more about the project.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by playhard on Monday March 19, 2012 @01:21PM (#3724974)
Awesome. loved it!
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by zbuc on Monday March 19, 2012 @01:37PM (#3725080)
Not working with my iPhone 4. Paired successfully with the game and Safari was showing the accelerometer values(which changed as I moved the phone) but my ship wouldn't move no matter what I did.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by wowfat on Monday March 19, 2012 @01:47PM (#3725142)
The game starts with a landing page (as in the link). After pairing is done then the browser will automatically redirect to the game page. Did that happen for you?
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by rralian on Monday March 19, 2012 @04:41PM (#3726096)
That happened, but it doesn't actually seem to accept the info from the iphone. I see the accelerometer readings on the iphone, but it doesn't seem to do anything with the page. I tried reloading the page on my laptop and on my phone. Best I could do was get it to move all the way to the left once and then just hang there. Neat idea, hopefully you can fix it.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by instakill on Tuesday March 20, 2012 @05:59AM (#3728507)
Mine doesn't redirect.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by zbuc on Monday March 19, 2012 @06:18PM (#3726600)
What rralian said -- it redirects, and I see the game, and my poor ship gets blown to bits because I can't move it.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by Ogre on Monday March 19, 2012 @04:51PM (#3726148)
Not working for me either, but my desktop browser has to go through a proxy at work. I suspect that's what's wrong here. I will try it again at home later.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by Toucan on Monday March 19, 2012 @01:48PM (#3725151)
Likewise, on a 4S with iOS 5.1.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by spanktheuser on Monday March 19, 2012 @02:52PM (#3725499)
Fixed a similar problem by turning off private browsing.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by sorotpe on Monday March 19, 2012 @01:52PM (#3725181)
just try reloading the page on your browser after pairing and it did work for me!
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by josteink on Monday March 19, 2012 @12:48PM (#3724746)
iOS only? Meh. It really is true: iOS is the new MSIE.

Somewhere down the road iOS-only code will not be accepted, and then we have tons of code already deployed which will never work on anything else, unless Apple's non-standard JS and webkit extensions are accounted for in other browsers.

This is hopeless and pathetic. And HN will love it.

Re:Use your iPhone/iPad as a controller for an HTML5 browser... by RegEx on Monday March 19, 2012 @01:13PM (#3724914)
I don't understand why fun projects can't just be fun projects...why does everything have to be interpreted as some sort of statement concerning the state of the web?
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by smileplease on Monday March 19, 2012 @01:23PM (#3724984)
It's iOS only because Android does NOT support accelerometer within the browser.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by nagoo on Monday March 19, 2012 @02:41PM (#3725444)
Also no websocket support in Android browser yet (http://caniuse.com/#feat=websockets). This makes things a little less ideal for realtime gameplay (even with the fallback options provided by socket.io).
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by nkassis on Monday March 19, 2012 @03:11PM (#3725635)
That's pretty sucky. Does anyone know if chrome for Android support it? I was hoping for WebGL and Websockets in 4.0 but I guess neither is around :(
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by ajross on Monday March 19, 2012 @04:17PM (#3725973)
This bug claims that it does: http://code.google.com/p/android/issues/detail?id=25221

The current direction does seem to be towards end-of-lifing the Android browser (and ChromeOS) and moving Chrome in as the default.

Re:Use your iPhone/iPad as a controller for an HTML5 browser... by nagoo on Monday March 19, 2012 @02:45PM (#3725464)
Should also note that DeviceOrientation (aka "accelerometer in the browser") is in Android 3.0+ (although that doesn't do much for most of the devices out there).

http://caniuse.com/#feat=deviceorientation

Re:Use your iPhone/iPad as a controller for an HTML5 browser... by idm on Monday March 19, 2012 @06:15PM (#3726590)
It's working with ICS, in the default browser.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by wahnfrieden on Monday March 19, 2012 @02:17PM (#3725327)
It's Android's fault for not supporting the accelerometer in its browser.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by J3L2404 on Monday March 19, 2012 @05:31PM (#3726346)
Hopeless and pathetic? They make good products. Get over it and make something yourself.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by tomjen3 on Monday March 19, 2012 @01:01PM (#3724842)
If it is the only accepted code, then it is by definition stand. It is just up to the others to implement these things.
Re:Use your iPhone/iPad as a controller for an HTML5 browser... by tikhonj on Monday March 19, 2012 @02:36PM (#3725420)
There are some very good reasons that, despite IE6's popularity and extreme market share--both larger than iOS, I believe--everybody else did not adopt IE6-only "features" like ActiveX as standards.