Streaming a video to multiple WPF clients - wpf

I need to stream a file from my server to several clients. I'm not sure which approach to take. I found Windows Media Services but all posts I read are three years old, and all examples are in C++. The content also primarily relates to Windows Server 2003 and/or Windows Media Player 9.
Is this the approach for streaming rich content to WPF clients? Can it really be so, that I cannot leverage the strengths of WPF, but I am forced to interact with DirectShow?
I noticed that my Windows Media Player 12 has some features about streaming content to other plaers, could this be leveraged? It seems like a nice approach that I don't have to go all in with Media Server/services.
What is the approach to this using WPF? Say I want to make 10 clients simultaneous stream the same file across the Internet - or "subscribe" to the same broadcast...

It seems like I have to use the RTSP protocol and Windows Media Server.

Related

Winform application for tablet?

I have a customer who wants an application for his travels where he can update an online DB, he doesn't want to buy a laptop, he wants a tablet or something similar. I have no knowledge nor desire in creating special apps for mobile devices, I want to create a winform just like I always did when it was targeted for pc. Tablet pcs (which from what I understood is just a regular pc?) are still very expensive in my country.
Is there a simple adjustment to make winform app run on a tablet with android or I have to build a special app for it? Any other solution? (I began in writing a web page for it, but it's much easier using winforms)
Native WinForms applications will not run directly on Android (or any non-Windows platform). You may want to begin by looking into MonoDroid for porting .NET code Android (and Mono in general for porting .NET code to non-Windows platforms).
A successful port across platforms will require that the application be structured in a very de-coupled manner. Core business logic in the abstract part of the application should be easily ported, but concrete implementations (specifically views and data/service access) will require some re-implementation for the different concrete platforms. So the overall architecture needs to be very de-coupled and pluggable.
Is a Windows tablet an option? Using various new technologies at Microsoft (Windows 8, Metro UI, etc.) you could build an application that would target multiple Microsoft-based platforms. This could easily satisfy the requirement of being "a tablet" (if the requirement isn't more specifically "an Android tablet"). However, it won't be the old WinForms style of applications.
In general you'll find that the industry has been steadily moving away from WinForms for, well, this exact reason. It doesn't port to other platforms, and there's a wide variety of platforms in demand today.
Forget convertion i was in a similar position years ago and i did something easier faster and i think smarter.
just make a winform with nice big controls take care of docking scaling anchors etc so that it will look nice and can be used with small smart devices.
Make sure you pass some start program parameters in your app and when a special parameter is passed instead of opening the main typically desktop form of your app open that new one in fullscreen.
Now the tricky parts isnelsewhere. I hade setup a tiny windows 2008 r2 server that allows remote apps to be run on it.
Create a user account that you will allow access to that server and only that app of yours with the specific parameter we talked about. (Ex myapp.exe -remote)
The what ever device he will get you can download the free app like 2x rdp or microsoft rdp in android. Make a new connection to your server (you can use any free ddns you like if you dont have a static ip) and connect with that windows server account you did before.
This account if has been properly setuped will only run your app and will only show that new mini winform you did..
The end user will do a simle click and from his internet connection will do a simple remote desktop that is linited to your app only. (Router configuration is needed once)
That way you will keep maintain just one source code and he will have low bandwidth cost and can continue his work without data loose in case of disconnection.
I use that for years in mobiles tablets and pos systems. Its fast its stable its secure its easy to maintain (nothing on the client side) and you don't waste months of learning wpf or doing xamarin converting.

What are the big major drawbacks porting a wpf LOB to silverlight 4

I am thinking about porting my alpha WPF MVVM application to silverlight.
I do not use 3D its a LOB ;-)
What I promise myself from the conversion is to get more customers in the end (Mac/nix user do not pay well ;P).
1.) At the moment I am using sqlite as database. Is it possible, that I can access the sqlite file on the harddisk of my user to read/save data? (on User dir its possible but access an USB stick ?)
2.) Is there anything concerning MVVM silverlight can not handle?
3.) Does SEO work well with Silverlight 4?
1.) At the moment I am using sqlite as database. Is it possible, that I can access the sqlite file on the harddisk of my user to read/save data? (on User dir its possible but access an USB stick ?)
If you want to use a local database then you'll either need to install your Silverlight application on the local machine as a full trust application or use a database that installs into Isolated Storage like SiaqoDb (as suggested by #Shawn Mclean). You won't be able to access a USB stick.
When run in a browser across the net it has limited access to the local hard drive for security reasons. If you're doing this you might as well stick with WPF.
2.) Is there anything concerning MVVM silverlight can not handle?
You can use Prism to develop MVVM applications for Silverlight as well as WPF.
3.) Does SEO work well with Silverlight 4?
I don't know a great deal about this, but Silverlight can be viewed as Microsoft's version of Flash so it will probably have the same SEO issues as Flash. The code is compiled and delivered to the client in binary form, so unless you split your application across multiple HTML/ASP.NET pages there won't be anything for Google to index. Apparently Flash does support SEO, but I haven't looked into SEO and Silverlight.
1.) At the moment I am using sqlite as database. Is it possible, that I can access the sqlite file on the harddisk of my user to read/save data? (on User dir its possible but access an USB stick ?)
The basic principal of Silverlight is centralised data over services. You can have local data, but that is not as useful generally compared to a central storage. You then have no worries about full trust as it will run in any Silverlight browser.
You can use SQLLite on your server, however the best free database option we have found is SQL Service Express 2008 R2.
You can access USB, but it requires both OOB, Full Trust and a custom COM automation object installed on the client (so Windows only). Basically forget local USB storage and support downloads instead, if local copies are needed.
2.) Is there anything concerning MVVM silverlight can not handle?
Bindings in Silverlight 4 are now very similar to those in WFP. Accessing parent elements from templates is a little more difficult, but most simple bindings are the same.
3.) Does SEO work well with Silverlight 4?
First ensure that you provide a sitemap for the searchengines. That should map to all content pages.
Provide a parallel ASP.Net website to publish your content for the search engines to read. This is now quite easy with RIA services as an ASP.Net website can consume a RIA service just like any other WCF service.
Make good use of headers, meta tags, titles, human-readable urls to include relevant keywords.

Silverlight, WPF or Windows Forms?

I need to create a desktop application for Windows and I'm in doubt about which technology to choose. Fact is that the application must do interaction with local resources:
Communication with SQL (need support for SQLite and MSSQL - local and remote, and would love to use NHibernate; maybe even with Castle's ActiveRecord)
Interaction with equipment connected via Bluetooth, Ethernet, USB and Serial (COM) port. I need to read a byte stream from sensors that connect via different protocols.
Preferably I'd go for Silverlight 4, and allow the application to run on the desktop with Full Trust. But I foresee problems with regards to these two requirements. Is there any solution for SL4, and if not, what alternative should I choose? I'm not limited to WPF or WinForms, but since it should run on .NET, I'm more or less limited to these 3 options (or am I?)
With a Silverlight app, you won't be able to connect to a SQL source without creating a service + you won't easily (or at all?) have access to the local resources such as COM port. If your app is intranet based, I'd go for WPF and click once deployment.
After you understand how to use WPF/Sliverlight controls, templates and data binding you will never want to touch WinForms again - it's not only that WPF/SL gives you a richer UI possibilities they just make it easier and less error prone to create applications (especially data-binding).
And it looks like you need relatively low level hardware access, even if it's possible with SL it will be easier with full .net
So, I would choose WPF
Just remember WPF/SL have a learning curve, if you never built a WPF project budget some time to learn the platform.
WPF would be your weapon of choice.
API-wise, WPF basically is a superset of Silverlight. Moreover you are in full control and have complete access to local resources.
If you are into .NET 4.0, you would probably enjoy Entity Framework, as an alternative to NHibernate. Not that it exceeds NHibernate in any way, but it integrates beautifully and comes with the package.
But, as Nir also stated, there's a learning curve for WPF.

Is it possible in Silverlight to stream a live video screencast of the desktop?

I would like to develop a web conferencing system (or web classroom) as a graduation project using Silverlight similar to
iVocalize
which is a java applete .
I don't know if what is possible for a java applete to perform on the PC is also possible for Silverlight, or is SL more restricted.
There are two functionalities (which are related i guess) that iVocalize provides which i would also like to include in my SL application, which are:
A participant may broadcast a live video stream of the desktop to other participants so that they will be able to follow all activities performed on the computer.
A participant may take a snapshot of the desktop
If the previous functionalities are not possible in SL than do you think that WPF may be used instead?
Thank you vey much.
Actually, you can use Silverlight 4 Web cam features.
With Silverlight 4, you can develop full-trust Silverlight application that can capture the snapshot of user desktop.
Using Silverlight it is possible.. Have a look at this open source silverlight project. Its has desktop sharing as one of the module
http://silverlightvideochat.codeplex.com/

Are ActiveX applets dead?

Are ActiveX applets as a technology supported by Microsoft dead?
What are the alternatives to ActiveX to create extremely rich internet applications using Microsoft Technologies? (Silverlight does not cut it for me, as it doesnt give me access to serial ports - or does it?)
You can of course still make ActiveX applications, but know that they will only work with Internet Explorer, unless users of other browsers install hosting plugins, that aren't all that good anyway.
In either case, a web application that requires access to a serial port? Are you sure you're not better off with a desktop application instead? A simple refresh and you've cut off that serial port.
Not all applications belong in the browser.
If you want to launch an application via a web browser that can access the serial ports, one option would be to use Java Web Start with JavaFX as the rich interface API, and Java Communications for the serial port access. You could end up with a cross-platform application at the end as well.
Or just write a native application using your favoured Windows toolkit if you absolutely are restricted to using Microsoft tools.
ActiveX as technology is very much alive, and will remain for many years to come. But its usage for Internet is dead. ActiveX is to be only used from within windows stand-alone applications.
ActiveX as of 2015 is a dead technology that even the maker is no longer interested in continuing to use it. Here is something to read.
No, Silverlight is designed from the ground up to be completely sandboxed, no way to bypasss that (thank god).
If you need that kind of access, but are looking for an easy deployment, I would suggest building a Clickonce application.
There are restrictions, because I think by default they are not full trust, but that's the best you will get.
It's also going to be the only easy route if you need printing (unless you are willing to round-trip to a server to generate a PDF file).
If you need direct access to some hardware (like for a POS software with cash drawer, receipt printer etc), you need to go "desktop". Clickonce can give you some deployment options, XBAPs can give you the "browser experience", but you are going to have to make compromises based on what your "hardware access needs" are.
EDIT:
I didn't notice the Silverlight exclusion in the original question. My comment it not really applicable. Sorry!
I don't know that I would call ActiveX dead just yet, but I would be cautious if you are planning to build an application based upon this technology. My recommendation would be to use Silverlight. This provides much of the functionality that is commonly desired in ActiveX controls, but uses the newer .NET technologies.
There is alot of talk about using Silverlight for media playback, but it has many powerful feature that can also be used to create Line-of-Business applications as well. In fact there is a great podcast episode on DotNetRocks that discusses this exact subject.
Here are a few more links that might point you in the right direction:
Microsoft Silverlight Getting Started
Silverlight 2 and a Glimpse of Silverlight 3 by Scott Guthrie
To the best of my knowledge, Silverlight 4 still doesn't give you direct access to serial ports, but it does give you access to any local web cam and microphones now. You could presumably also run Silverlight 4 out-of-browser, which gives you access to COM objects, and you could write a quick-and-dirty COM object which wrapped serial port access. That said, I also agree with what folks said above about not all applications belonging in the browser.

Resources