Live data from Hacker News

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

austingil.com

201–210 of 240 posts

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

#201

Another cool website that I came across a few days ago is https://vdo.ninja/ (create reusable invite option) which also uses the HTML camera APIs to connect your mobile phone to OBS. Both the audio and video quality I get from my phone is at par or sometimes even superior to my laptop's webcam. This video tutorial(1) explains the setup really well. Kudos to whoever made this free site and also the modern browser tech…

VDO Ninja is great. I've used it to stream on Twitch with a friend, so that each of us could have a live video capture in the Twitch stream. (The main streamer uses OBS, added a browser source pointing to a VDO Ninja room, and then the other person joins the VDO Ninja room and streams their own video feed into it.)

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

#202
post #198
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 ]

Do you have a link to any of your photographic work?

I'm always too lazy to make an online gallery, and I don't want HN knowing my instagram. But I just made a few snaps of what I had around and put them here. https://golden-taffy-476b64.netlify.app/photos_m/

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

#203
post #59

> all of those unsupported browsers are actually desktop browsers where there isn’t a front facing or back facing camera Any laptop sold in the last 10+ years?

I have a desktop computer. But thanks to COVID days even I have a webcam attached. Limiting it to non-desktop/laptop use does seem to be an oversight.

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

#204

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 a…

Hmm, I don't get it. In the site you linked I see

"It appears @capture is not supported and @accept is supported." for Safari, Firefox and Chrome on MacOS.

I see two buttons, Choose File and Upload. Upload is just a placeholder that shows a 405 error so I'll ignore that. Choose File just lets me choose a file, but there's no option to take a picture.

What am I missing here?

EDIT: nvm I see that it only works on mobile:

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes...

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

#205

Earlier quoted context omitted.

Because its the securest way we have to launch any app on any device. With binaries, any binary might be malicious and therefore I can only trust and run a very small amount of selected binaries. With web apps, I can launch whatever I want without compromising my system.

> With web apps, I can launch whatever I want without compromising my system. What makes you think web apps can't enable exploits that compromise your system? Anything that can run code on your machine enables attacks. Even Javascript that gets run in browsers have enabled attacks on the local system. If anything web apps decrease your security since a binary can be vetted and verified as unchanged, but when you open…

That may be plausible in some limited cases (iOS) but on most platforms opening an untrusted native app is much more risky than opening an untrusted website. For example, a native app has access to the file system, which is all that is necessary to enable ransomware attacks.

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

#206
post #196

Earlier quoted context omitted.

Wouldn't that be a ridiculously dumb heuristic to employ?

Who ever said corporate IT was smart?

Another view of it: Someone in Management sent a message something like "Stop pointing me to the Scunthorpe Problem wikipedia page[1], just block all these sites" directive and this was the easiest way to resolve it permanently.

[1] https://en.wikipedia.org/wiki/Scunthorpe_problem

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

#207
post #28

Hyper Text Markup Language ...why is a markup language for hypertext able to control my device's camera? Why have all the relevant standards bodies associated with this language and protocol gotten on board with turning a markup display language into a full-blown OS?

I find it incredible that people still think HTML, a spec first published in 1990 when we were using 386s with CGA monitors, shouldn't have evolved to utilise some of the modern features available on today's computers and phones. Why wouldn't we want to be able to do useful things on the web with our devices?

>Why wouldn't we want to be able to [run interactive apps] web with our devices?

Because the web is for hypertext, which means static content. Images, text, video and audio clips, tables, code snippets, etc. Of course even that subset it does unimaginably bad, okay? Interactive web apps fucking suck, so that takes care of that 50%. For the other 50%, which is document viewing, why in the hell would I want pages to be able to move stuff around and create their own custom UIs and color schemes for every document I view? That use case is for magazines, a content-free medium. It's actually hilarious how people think hosting their library documentation on some stupid website like readthedocs.io, or publishing scientific journals behind IP blocklists (aka misconfigured bullshit from some charlatan sysadmin) is "progress".

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

#208

Hyper Text Markup Language ...why is a markup language for hypertext able to control my device's camera? Why have all the relevant standards bodies associated with this language and protocol gotten on board with turning a markup display language into a full-blown OS?

Because it's the easiest way to distribute software. The alternative to standards is every browser vendor doing their own thing, and "this website only works on IE". Remember the bad old days of the web where every bank required Windows because their UI was implemented with ActiveX? Standards killed that and now you can view your bank account on Linux. WebRTC has its security downsides, but probably better than runni…

> Because it's the easiest way to distribute software.

Not really, webdev is a pain just as much as making a native Windows app or Go binary. Programming is bullshit all the way down. The moment you try to do anything correct in absolutely any modern software stack or framework, you will have to do a bunch of hacks to indirectly force stuff into doing what's needed for your program to be correct. Of course in practice everyone just skips this part, contributing to the said problem.

> Standards killed that and now you can view your bank account on Linux.

But I literally can't view certain bank websites with Firefox.

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

#209

Earlier quoted context omitted.

> With web apps, I can launch whatever I want without compromising my system. What makes you think web apps can't enable exploits that compromise your system? Anything that can run code on your machine enables attacks. Even Javascript that gets run in browsers have enabled attacks on the local system. If anything web apps decrease your security since a binary can be vetted and verified as unchanged, but when you open…

That may be plausible in some limited cases (iOS) but on most platforms opening an untrusted native app is much more risky than opening an untrusted website. For example, a native app has access to the file system, which is all that is necessary to enable ransomware attacks.

> For example, a native app has access to the file system

web apps also have access to the file system, although there are extra steps

https://developer.mozilla.org/en-US/docs/Web/API/File_System...

Here's a shell! https://rreverser.com/webassembly-shell-with-a-real-filesyst...

Webassembly is overwhelmingly used for malware (https://www.crowdstrike.com/blog/ecriminals-increasingly-use...) but at least it's usually just mining cryptocurrency. I'd guess it's only a matter of time before it's commonly used for much worse.

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

#210

I can't get over the fact, that he is using "a public internet URL" to tunnel the traffic to his local server, just to watch it on his phone. What he should have done: - Make his local server listen on his local ip like >:3000 instead of just 127.0.0.1:3000 - Connect his cellphone to his local lan with wifi. - Look at the site on >:3000 on his cellphone. I would never make a connection from a public Domain to my loca…

You know that a URL can be mapped to any IP including private address ranges via DNS right?
Post reply on HN