Live data from Hacker News

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

austingil.com

141–150 of 240 posts

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

#141
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

USB/Bluetooth is underrated because it means you can ship hardware products that can have their firmware updated or connect and sync with a web service without having to build/ship/maintain a whole app for it that will eventually stop working after an OS update.

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

#142
post #77

Earlier quoted context omitted.

Thanks for saying this, as I know a lot of people on HN have very negative feelings towards this trend. Personally, I feel the browser is a great way to stop reinventing the wheel, and the APIs abstract away a lot of the heavy lifting. They pretty much get you 80% of the way there, and the last 20% is where you can really add the stamp of "uniqueness" to your implementation. The fact that the browser is also heavily…

It just feels like every time software developers can't (or won't) build things cross-platform, users end up with bigger and bloatier solutions and poorer experiences. First, it was cross-platform UI toolkits and OS abstractions like Qt (require users to use a big, "lowest common denominator compromise" library ) Then, it was web apps (require users to provide a browser) Then, it was Electron and friends (ship the wh…

> Then, Docker and containers (ship the whole OS with the application)

𝚃̶𝚘̶ ̶𝚋̶𝚎̶ ̶𝚏̶𝚊̶𝚒̶𝚛̶,̶ ̶𝚝̶𝚑̶𝚊̶𝚝̶'̶𝚜̶ ̶𝚜̶𝚑̶𝚒̶𝚙̶𝚙̶𝚒̶𝚗̶𝚐̶ ̶𝚝̶𝚑̶𝚎̶ ̶̶𝚔̶𝚎̶𝚛̶𝚗̶𝚎̶𝚕̶̶ ̶𝚊̶𝚗̶𝚍̶ ̶𝚗̶𝚎̶𝚎̶𝚍̶𝚎̶𝚍̶ ̶𝚙̶𝚊̶𝚌̶𝚔̶𝚊̶𝚐̶𝚎̶𝚜̶ ̶𝚠̶𝚒̶𝚝̶𝚑̶ ̶𝚝̶𝚑̶𝚎̶ ̶𝚊̶𝚙̶𝚙̶𝚕̶𝚒̶𝚌̶𝚊̶𝚝̶𝚒̶𝚘̶𝚗̶.̶ ̶ ̶𝚃̶𝚑̶𝚊̶𝚝̶'̶𝚜̶ ̶𝚙̶𝚎̶𝚍̶𝚊̶𝚗̶𝚝̶𝚒̶𝚌̶,̶ ̶𝙸̶ ̶𝚔̶𝚗̶𝚘̶𝚠̶,̶ ̶𝚊̶𝚗̶𝚍̶ ̶𝚠̶𝚑̶𝚒̶𝚕̶𝚎̶ ̶𝚠̶𝚑̶𝚊̶𝚝̶ ̶𝚢̶𝚘̶𝚞̶ ̶𝚜̶𝚊̶𝚒̶𝚍̶ ̶𝚒̶𝚜̶ ̶̶𝚝̶𝚎̶𝚌̶𝚑̶𝚗̶𝚒̶𝚌̶𝚊̶𝚕̶𝚕̶𝚢̶̶ ̶𝚝̶𝚛̶𝚞̶𝚎̶,̶ ̶𝚛̶𝚎̶𝚖̶𝚘̶𝚟̶𝚒̶𝚗̶𝚐̶ ̶𝚘̶𝚗̶𝚎̶ ̶𝚕̶𝚎̶𝚟̶𝚎̶𝚕̶ ̶𝚘̶𝚏̶ ̶𝚊̶𝚋̶𝚜̶𝚝̶𝚛̶𝚊̶𝚌̶𝚝̶𝚒̶𝚘̶𝚗̶ ̶𝚏̶𝚛̶𝚘̶𝚖̶ ̶𝚝̶𝚑̶𝚎̶ ̶𝚍̶𝚎̶𝚜̶𝚌̶𝚛̶𝚒̶𝚙̶𝚝̶𝚒̶𝚘̶𝚗̶ ̶𝚛̶𝚎̶𝚊̶𝚕̶𝚕̶𝚢̶ ̶𝚌̶𝚑̶𝚊̶𝚗̶𝚐̶𝚎̶𝚜̶ ̶𝚝̶𝚑̶𝚎̶ ̶𝚖̶𝚎̶𝚊̶𝚗̶𝚒̶𝚗̶𝚐̶ ̶𝚜̶𝚒̶𝚐̶𝚗̶𝚒̶𝚏̶𝚒̶𝚌̶𝚊̶𝚗̶𝚝̶𝚕̶𝚢̶.̶ ̶ ̶𝚃̶𝚑̶𝚎̶ ̶𝙻̶𝚒̶𝚗̶𝚞̶𝚡̶ ̶𝚔̶𝚎̶𝚛̶𝚗̶𝚎̶𝚕̶ ̶𝚘̶𝚗̶ ̶𝚒̶𝚝̶𝚜̶ ̶𝚘̶𝚠̶𝚗̶ ̶𝚒̶𝚜̶ ̶𝚜̶𝚘̶𝚖̶𝚎̶𝚝̶𝚑̶𝚒̶𝚗̶𝚐̶ ̶𝚕̶𝚒̶𝚔̶𝚎̶ ̶𝟷̶𝟶̶ ̶𝚖̶𝚎̶𝚐̶𝚊̶𝚋̶𝚢̶𝚝̶𝚎̶𝚜̶.̶

EDIT: What I've said is not exactly correct. If you're not running Docker on a Linux host, then you'll have a Linux kernel running in emulation but it's not shipping with containers. Not sure what I was thinking. I believe this is closer to the truth.

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

#143
post #96

Earlier quoted context omitted.

My answer to this is that the calendar just does not need to be a web app. Weakening a primary advantage of everything else on the web just so that my calendar can be a web app seems like a poor trade-off. Re: sound, "Triggered as the result of a user action" is not a high enough bar.

Calendars are far more useful as web apps than other incarnations; you can open them anywhere and don't have to carry a specific artifact with you to do it.

a web view for caldav is just fine (and how I use outlook currently); but for notifications a proper program is definitely preferable.

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

#144

Earlier quoted context omitted.

It just feels like every time software developers can't (or won't) build things cross-platform, users end up with bigger and bloatier solutions and poorer experiences. First, it was cross-platform UI toolkits and OS abstractions like Qt (require users to use a big, "lowest common denominator compromise" library ) Then, it was web apps (require users to provide a browser) Then, it was Electron and friends (ship the wh…

> Then, Docker and containers (ship the whole OS with the application) 𝚃̶𝚘̶ ̶𝚋̶𝚎̶ ̶𝚏̶𝚊̶𝚒̶𝚛̶,̶ ̶𝚝̶𝚑̶𝚊̶𝚝̶'̶𝚜̶ ̶𝚜̶𝚑̶𝚒̶𝚙̶𝚙̶𝚒̶𝚗̶𝚐̶ ̶𝚝̶𝚑̶𝚎̶ ̶ ̶𝚔̶𝚎̶𝚛̶𝚗̶𝚎̶𝚕̶ ̶ ̶𝚊̶𝚗̶𝚍̶ ̶𝚗̶𝚎̶𝚎̶𝚍̶𝚎̶𝚍̶ ̶𝚙̶𝚊̶𝚌̶𝚔̶𝚊̶𝚐̶𝚎̶𝚜̶ ̶𝚠̶𝚒̶𝚝̶𝚑̶ ̶𝚝̶𝚑̶𝚎̶ ̶𝚊̶𝚙̶𝚙̶𝚕̶𝚒̶𝚌̶𝚊̶𝚝̶𝚒̶𝚘̶𝚗̶.̶ ̶ ̶𝚃̶𝚑̶𝚊̶𝚝̶'̶𝚜̶ ̶𝚙̶𝚎̶𝚍̶𝚊̶𝚗̶𝚝̶𝚒̶𝚌̶,̶ ̶𝙸̶ ̶𝚔̶𝚗̶𝚘̶𝚠̶,̶ ̶𝚊̶𝚗̶𝚍̶ ̶𝚠̶𝚑̶𝚒̶𝚕̶𝚎̶ ̶𝚠̶𝚑̶𝚊̶𝚝̶ ̶𝚢̶𝚘̶…

I thought docker used the host kernel with a different rootfs?

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

#145
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 ]

I'm getting a blank screen on Firefox for Android :(

do you perhaps have the phone laying on a table? that's what it was for me hahahaha

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

#146

Earlier quoted context omitted.

It just feels like every time software developers can't (or won't) build things cross-platform, users end up with bigger and bloatier solutions and poorer experiences. First, it was cross-platform UI toolkits and OS abstractions like Qt (require users to use a big, "lowest common denominator compromise" library ) Then, it was web apps (require users to provide a browser) Then, it was Electron and friends (ship the wh…

> Then, Docker and containers (ship the whole OS with the application) 𝚃̶𝚘̶ ̶𝚋̶𝚎̶ ̶𝚏̶𝚊̶𝚒̶𝚛̶,̶ ̶𝚝̶𝚑̶𝚊̶𝚝̶'̶𝚜̶ ̶𝚜̶𝚑̶𝚒̶𝚙̶𝚙̶𝚒̶𝚗̶𝚐̶ ̶𝚝̶𝚑̶𝚎̶ ̶ ̶𝚔̶𝚎̶𝚛̶𝚗̶𝚎̶𝚕̶ ̶ ̶𝚊̶𝚗̶𝚍̶ ̶𝚗̶𝚎̶𝚎̶𝚍̶𝚎̶𝚍̶ ̶𝚙̶𝚊̶𝚌̶𝚔̶𝚊̶𝚐̶𝚎̶𝚜̶ ̶𝚠̶𝚒̶𝚝̶𝚑̶ ̶𝚝̶𝚑̶𝚎̶ ̶𝚊̶𝚙̶𝚙̶𝚕̶𝚒̶𝚌̶𝚊̶𝚝̶𝚒̶𝚘̶𝚗̶.̶ ̶ ̶𝚃̶𝚑̶𝚊̶𝚝̶'̶𝚜̶ ̶𝚙̶𝚎̶𝚍̶𝚊̶𝚗̶𝚝̶𝚒̶𝚌̶,̶ ̶𝙸̶ ̶𝚔̶𝚗̶𝚘̶𝚠̶,̶ ̶𝚊̶𝚗̶𝚍̶ ̶𝚠̶𝚑̶𝚒̶𝚕̶𝚎̶ ̶𝚠̶𝚑̶𝚊̶𝚝̶ ̶𝚢̶𝚘̶…

Containers don't ship a kernel, just the userspace.

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

#147
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

A lot of those are Chrome-only.

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

#148
post #62
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

Old enough to remember when the accelerometer didn't require permission to access.

It was useful an API to detect if a client was faking their user agent or was a bot. When I worked for a neo bank we abuse all the APIs to detect if client was a real person or not without having to use captchas.

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

#149
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

USB/Bluetooth is underrated because it means you can ship hardware products that can have their firmware updated or connect and sync with a web service without having to build/ship/maintain a whole app for it that will eventually stop working after an OS update.

Is Bluetooth good yet?

I had issues as recent as last year's new products.

But otherwise I love the concept of hardware access with HTML. The embedded guy in me thinks the future is going to be crazy. I can't quite wrap my head around the possibilities.

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

#150
post #18

Earlier quoted context omitted.

Note that this uses the JavaScript MediaDevices API to stream the camera, which is different from OP's link (which is a file picker input that launches the mobile camera instead of going to the photo gallery)

However, ‘filter: invert(1)’ on top of the OP’s approach should do the same. https://developer.mozilla.org/en-US/docs/Web/CSS/filter-func...

OP's approach doesn't display the camera image on-page at all.
Post reply on HN