How to display webcam on client side only? - browser

I'd like to show a webcam inside a browser without any server interaction.
Everything should happen client side with minimal plugins usage.
This would replicate most default webcam software bundled with the cam itself.

You would need a plugin for each major browser (or an active x control for IE) to communicate locally with the phone. Because of security, you can not interact with local devices in a browser.
You could however write a little server that runs on localhost and serves a flash or mpeg stream. Then it would be easy to link that webcam to a web page running on the same computer. This would not require any plugins, but it does require that you write a http server to talk to the cam and serve its stream to the browser.

Related

Connect to USB RFID reader with browser

I am a newbie dev trying to build a web application that can read and write to an RFID Card through the browser.
I am currently using an ACR122U Card Reader and have gotten it reading directly to my server in NodeJS with the nfc-pcsc node package.
Of course, I don't want to have my users have to run their own server and install a ton of libraries to read a card.
Ideally, they can just plug a card reader into their USB port and communicate from USB>Browser>Node Server and back again.
Can anyone recommend a good way to communicate with a USB RFID reader through the browser (and send to backend server?). Thanks
As far as I know, at the moment (Mar.2021) there is only experimental support for USB in browsers (WebUSB API). Please refer to https://developer.mozilla.org/en-US/docs/Web/API/USB
As this API is experimental, you may not want to rely on it for production. In this case, a component running on end users machine will be needed (e.g. a more or less simple service that responds via https at 'localhost'. This approach opens several usability/security concerns (such as supplying a trusted certificate for localhost, properly managing CORS headers etc).
You may want to refer to this question for additional suggestion: Architectures to access Smart Card from a generic browser? Or: How to bridge the gap from browser to PC/SC stack?

Website audio output play on raspberry pi

I create a website using iframe embed youtube video.I use apache2 web server on my raspberry pi and open the website by another device. The audio play on my own device instead of raspberry pi. I need it to play on raspberry pi.
My code:
<iframe width="560" height="315" src="https://www.youtube.com/embed/b4Bj7Zb-YD4" frameborder="0" allowfullscreen></iframe>
Should I use javascript or php?
How should I do?
You are loading it like webPage from server that's why it plays on Your device.
If You would like it to play that sound on RPI, the RPI itself should connect as client to that server.
I would recommend using sockets to play Your sound on node server. For that You will need to use node.js and sockets. There is a module for node https://www.npmjs.com/package/play-sound
You should make Your own server with node and use another device to send socket event to RPI server to play some mp3 files.
If You need to see video on Your other device and play sound on Your RPI like home theater style it will be a problem with usage of server because that sound has nothing to do with RPI, Your other device takes the link for youtube video.
Would recommend connecting display to RPI and browser on RPI making connection to localhost (Apache server).
I can post some example if there is a need to make sound player.
Also use this as start point for making server I made an answer there:
Server

Build own Chromecast device

The Chromecast device is a "receiver device [that] runs a scaled-down Chrome browser with a receiver application". Can I download and install this receiver app on a chrome browser for example on my Windows notebook?
I have implemented a complete chromecast v2 receiver, called YouMap ChromeCast Receiver, available in Google play store and Amazon store, xda-developer thread here: http://forum.xda-developers.com/android-tv/chromecast/app-youmap-chromecast-receiver-android-t3161851
The current Chromecast protocol is a completely different one from the original DIAL based protocol. Right now, only YouTube still uses the old protocol, which chromecast maintains its backward compatibility.
The discovery is mDNS, exactly same as Apple TV bonjour protocol.
The most difficult part is device authentication, the sender and the receiver perform handshakes by exchanging keys and certificates in a way extremely difficult to crack. AppleTV does the same using FairPlay encryption.
The next difficult part is the mirroring protocol, which is also very complicated, need to deal with packet splits, packet retransmissions. Overall, chromecast mirroring protocol is well designed, better than miracast, better than AirPlay mirroring (I have also implemented both of them, so I know what I am talking about).
When I get chances, will write more here.
The chromecast device works using the DIAL protocol. It is completely possible to emulate this protocol using some simple code to listen on the multicast group for discovery and then handle the HTTP requests to launch applications. It is then the launched application that communicates with the casting device, I believe using the RAMP protocol.
Luckily for us the applications that the chromecast device uses are mostly web applications meaning our device emulator just needs to launch a web browser and point it to a specific url when it receives an application request.
For example the youtube app, after device discovery and establishing where the applications are located (part of DIAL). Will send a HTTP POST request containing a pairing key to /<apps url>/YouTube. All the emulating device needs to do now is open https://www.youtube.com/tv?<pairing key> in a browser window. From here, I believe, communication for controlling the youtube app is not sent through the casting device but through the open tabs on the casting device and the emulator.
This is my understanding of how the chromecast device works and specifically the youtube app from looking at https://github.com/dz0ny/leapcast which is a python emulator that has youtube and google music working.
Google is in progress of open sourcing some part of the chrome cast.
https://code.google.com/p/chromium/codesearch#chromium/src/chromecast/
https://code.google.com/p/chromium/issues/list?q=label:Chromecast
So theoretically you can build a similar device.

Access to serial port from web browser

I'm trying to access serial port through web browser.
The reason is for downloading firmware to a device that is connected to the same machine that is running the browser (via USB to rs-232).
I'v searched around and have seen that this is doable via Silverlight, but this is Windows only centric since it requires COM support, while my main operating system is Linux, then Windows and then Mac.
I know it's easy to develop JavaFX / QT / Mono / AIR cross platform applications, but those require installing a huge runtime binaries and only then run the application.
I'm trying to keep it really simple, plug your device, visit a web site and it will auto install your application.
Do you guys think it's possible?
Thanks.
https://code.google.com/p/java-simple-serial-connector/
Since Java is cross platform, this would be the only thing required to get the serial support you need in browser.
(not exactly a security nightmare as #"awm" proposed) You could implement a websocket on the localhost, expose a port that is rarely used and call that websocket to open the serial port and feed data to the device to upgrade the firmware.

Sending voice over the net and get it with HTML5 and mobile apps

I'm trying to put in place a basic streaming system from the browser.
The idea is to let the user stream audio live from his mic through the browser and then allow others to listen to this stream with their browser (desktop, mobile, etc ...) and iOS/Android apps.
I started doing some tests with the Red5 Server (which is a great free alternative to the Flash Media Server).
With this technologie, I can publish a stream with the RTMP (ex: rtmp://myserver/myApp).
But the problem is that I can't find a way to read the published stream on other plateforms (using the video tag with HTML5, in iOS, etc ...).
As i failed to that, my question is:
How can I let a user to stream his voice over the net (using flash or not) and then allow the others to listen to that stream by using lightweight technologies (HTML5) and mobile apps?
Thanks,
Regards
Looks like RED5 should be able to do what you want...
0.9.0 RC2 has the ability to:
Streaming Audio (MP3, F4A, M4A)
Recording Client Streams (FLV only)
some links that may help:
http://osflash.org/pipermail/red5_osflash.org/2007-April/010400.html
http://www.red5chat.com/
Though not exactly what you're after, you could take a look at BigBlueButton which is a web conferencing suite based on open source components (RED5 is one of them). It's has a rather complex architecture but they do have a flash based client you can take a loot at.

Resources