5

I have an unusual situation - I have an embedded video streaming device with a complicated UI, and I need to use an embedded web server to reproduce that UI through a web browser. I'm thinking of using JavaScript/JQuery on a C++ backend (I am NOT coding all this myself, I need to hire people for the grunt work).

The embedded web server is much less powerful than a PC, so I want to write an application that runs the entire UI in the browser, and only communicates with the server to pass new program settings back and forth, get status updates from the device, and control video playback.

In other words, the client gets one big page or a small number of big pages (effectively downloading the application), the application maintains significant local memory storage, and once the pages are first loaded the server never sends anything layout-related.

The application has two rows of tabs to navigate ~40 menu pages, drag-and-select controls to pick cells in a grid, sorted lists, lots of standard data entry options, and it should be able to control up to 16 embedded video players at once (preferably VLC).

Is this possible in JavaScript/JQuery with a C++ backend?

2
  • FWIW, complex applications in a browser are very possible these days. Just witness Gmail, Yahoo Mail, etc, all of which are substantial pieces of software that get run entirely in the browser. Commented May 19, 2010 at 20:30
  • Yes, you can use v8 via c++ (also, duktape is a javascript engine targetting embedded systems written in C)... in fact, the linux distro Slitaz (and some others) use plain shell scripts with busybox utilities for their configuration gui (tazpanel). I don't know what kind of hardware you have, but if the have hardware accelerated video, it is often enough to use a minimal build of curl to directly stream /dev/videoXX over a udp/tcp connection... the rest should just be a nightmare of css with some easy html and client side js to put video in an html5 player. Commented Mar 27, 2015 at 11:29

5 Answers 5

2

Ext JS would save you a lot on the UI side, it can be used to create very complicated layouts with rich controls in very little time. It even has its own graphical editor where you can create the UI prior to adding handlers.

Its API Documentation is also very good, its far better than most other libraries.

And for the rest, well, I'm pretty sure that there are ready made webservers that you could look into; take a look here - most of these can probably expose a CGI application.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the link, Ext JS looks like it might be very convenient because of the number of predefined UI elements.
But to beat the rest, it does have its flaws, but none bigger than any of the other libraries...
1

It's definitely possible. Look into Jquery's AJAX framework for communicating with the server, and then look at some C++ web toolkits for making some lightweight web service controllers.

Comments

1

Everything is possible.

Is it worth it? Depends on your requirements. Keep in mind:

  • You'll have to have some kind of application server support. Coding it by hand will take resources.
  • You'll also have to update the c++ executable on the embedded device. You may potentially end up supporting multiple devices. So this can be a problem if a number of supported devices grows.
  • c++ engineering resources are typically more expensive (and with cheap c++ engineers you'll pay 2x in bugfixes) vs php/ruby/perl developers on the server.

2 Comments

Remember this is an embedded web server, like I said it is much less powerful than a PC. PHP barely fits in memory and Perl's performance is not tolerable. That's one reason I want to have complicated "web stuff" done on the client, so the server just has to do video streaming, interface with the device firmware, etc. My thought is to extend the device's local Qt application to have more server-friendly APIs, then have a thin C++ layer running under the Lighttpd web server.
My 3rd bullet was meant to be "php/ruby/pearl on the server side, not embedded". Aside from that implementing http server is very easy (read transport), but providing application support is more complex. Overall it boils down to thin/thick client conversation.
0

You might want to take a look at using Dojo as opposed to jquery. Its really gear more towards this type of thing. By no means does that mean you couldnt do it in jquery, Dojo is just better design IMO to create an entire JS application. Of course it should be noted that this also makes its usage much more complex than jQuery's.

Comments

-1

You might instead consider a rich client technology like Silverlight. Complicated UI is what it's built for and the development experience is much nicer than most other options.

Silverlight doesn't require .NET on the server and can easily communicate over simple REST or SOAP services (see gSOAP).

3 Comments

However Silverlight does require a client-side plugin, and especially on Linux I don't want to require users to install plugins. JavaScript comes with every browser and "make sure JavaScript is turned on" isn't much to ask of people who want to use the app.
That wasn't stated anywhere in your question. I think the downvote is a little harsh.
I didn't downvote it, I'm not registered with this site. However I do think that requiring the client to install a plugin is something unusual that should be mentioned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.