Live data from Hacker News

TIL: You can access a user’s camera with just HTML

austingil.com

81–90 of 240 posts

Re: TIL: You can access a user’s camera with just HTML

#81
post #35

Earlier quoted context omitted.

And theres a LOT more APIs than people realize: https://developer.mozilla.org/en-US/docs/Web/API Some interesting ones: - Screen recording/capture - Battery status - Barcode Detection - Bluetooth - Sensors (e.g. Accelerometer) - Wake/screen lock - Color picker - Vibration - MIDI - USB - Contacts picker - Presentation (AirPlay, Chromecast) - Virtual reality

These are all Javascript APIs. I think what's particularly notable about the OP is that it's HTML.

Yes but the person I'm replying to is talking about JS APIs

Re: TIL: You can access a user’s camera with just HTML

#83

A lot of totally valid opinions out there about this, but I personally _love_ how the browser is becoming a very well-featured sandbox for shipping applications. For personal fun and learning, I'm making a complete 2D video game in ideally less than 1MB. It has 60fps graphics, full spatial audio, and gamepad support, all because the browser has a lot of these APIs that didn't exist when I was starting out my career.…

I recognize that this kind of thing is useful to the developer, of course, and we've gotten a lot of neat things this way.

My worry is basically that the absent functionality is the best thing about the web as a user. Take the notification API: One of the nice things about web pages and apps is that they stop bothering me once I close them; not so if I accidentally permit notifications! Fortunately I can turn that whole feature off, but at first I found myself wondering who ever thought that would be a good idea.

Yes I picked an extreme example, and I don't actually mind some of these things. I wish there were a permission pop-up before playing sound at all. Also, WebGL does concern me, since heavy GPU usage can draw a lot of power. Things like gamepad support and spatial audio (if they are behind permission pop-ups) don't really bother me, though.

Re: TIL: You can access a user’s camera with just HTML

#84
HTML media capture is superb. I have successfully used it in production, and I was surprised by how simple it was and how well it worked. I learned about it from here[0].

It's cool because if you have an app that requires users uploading pictures, you just need an HTML , an with `capture`, and a few lines of code in the backend. I thought I would need to do some JavaScript gymnastics, and it ended up taking just an afternoon to design, develop, and deploy.

[0]: https://anssiko.github.io/html-media-capture/

Re: TIL: You can access a user’s camera with just HTML

#85
post #35

A lot of totally valid opinions out there about this, but I personally _love_ how the browser is becoming a very well-featured sandbox for shipping applications. For personal fun and learning, I'm making a complete 2D video game in ideally less than 1MB. It has 60fps graphics, full spatial audio, and gamepad support, all because the browser has a lot of these APIs that didn't exist when I was starting out my career.…

And theres a LOT more APIs than people realize: https://developer.mozilla.org/en-US/docs/Web/API Some interesting ones: - Screen recording/capture - Battery status - Barcode Detection - Bluetooth - Sensors (e.g. Accelerometer) - Wake/screen lock - Color picker - Vibration - MIDI - USB - Contacts picker - Presentation (AirPlay, Chromecast) - Virtual reality

Unfortunately many of these leak identifying datapoints so due to abuse they are now blocked.

Re: TIL: You can access a user’s camera with just HTML

#86
post #83

A lot of totally valid opinions out there about this, but I personally _love_ how the browser is becoming a very well-featured sandbox for shipping applications. For personal fun and learning, I'm making a complete 2D video game in ideally less than 1MB. It has 60fps graphics, full spatial audio, and gamepad support, all because the browser has a lot of these APIs that didn't exist when I was starting out my career.…

I recognize that this kind of thing is useful to the developer, of course, and we've gotten a lot of neat things this way. My worry is basically that the absent functionality is the best thing about the web as a user. Take the notification API: One of the nice things about web pages and apps is that they stop bothering me once I close them; not so if I accidentally permit notifications! Fortunately I can turn that wh…

I don't know, this seems like a good compromise to me. Some apps (calendar) would be absolutely crippled without them. For everything else, I've just never turned them on in the first place.

> I wish there were a permission pop-up before playing sound at all

The browser can't actually play sound unless 1) it's triggered as the result of a user action (such as a mouse click) or 2) if you've often listened to sound on that page in the past.

Re: TIL: You can access a user’s camera with just HTML

#88
post #9

This is a site that shows the camera feed full screen and inverts in with css https://nega.radioac.dev/ I hacked it together in half an hour to give people a way to look at the uninverted version of my inverted analogue photos with their phones at exhibitions. most people were more excited to play with it on their phone than by the photos I took days making. :'( [edit oops this javascript ]

It said with just HTML.... that site requires Javascript.

Re: TIL: You can access a user’s camera with just HTML

#89
post #14

Earlier quoted context omitted.

You cover your phone camera? This only works on mobile and pops up the native Android/iOS camera which requires you to actually take the picture (and at least on iOS, asks you to confirm you would like to use the photo before going back to the website)

I habitually cover the camera on my phone when I'm not using it. It's just common sense for any connected device running complicated software without hardware switches to turn the sensors off reliably. The latter would be better of course but there wasn't a practical option for it last time I was looking for a new phone.

Last time I looked only the pinephone had hardware switches, and they were under the case making it kind of clunky to turn them on and off.

Re: TIL: You can access a user’s camera with just HTML

#90

A lot of totally valid opinions out there about this, but I personally _love_ how the browser is becoming a very well-featured sandbox for shipping applications. For personal fun and learning, I'm making a complete 2D video game in ideally less than 1MB. It has 60fps graphics, full spatial audio, and gamepad support, all because the browser has a lot of these APIs that didn't exist when I was starting out my career.…

The thing I don't like about the browser becoming that is that every web page will now have tons of prompts. Something we were trying to kill off with IE years ago because too many people just click "accept".

The thing I like about it is what you just said.

Post reply on HN