IIS and WPF video streaming - wpf

I need someone to point to right direction in both silverlight in WPF video streaming.
I have two projects, one is a Silverlight web page and the other is a WPF project. The goal is, on the WPF application the user is able to upload a video to the server, and the Silverlight web page streams it using a any web protocol (most likely http).
I'm using Expression Encoder SDK to build the code that re-encodes the video files (since the original video files will be very big, over 1gb each), and so far I think I've got it right, but now I need to stream it on the web, and I'm not being able to do so.
The silverlight web page is hosted on a Windows Server 2008 R2 with IIS 7.0.
I've been reading about IIS streaming, but everything I find points that every time the user wants to add a video, it must go to IIS interface and add it manually, and that cannot be the only way, since the user knows nothing about IIS.
If possible I would like some code examples on how to achieve streaming through IIS, and some pointer on what I could do, or am doing wrong...
Thanks

I dont see why user have to manually do it everytime in IIS. From your WPF app, make it store your video in a specific location inside your IIS. Also do a one time configuration in your IIS to deliver the video extension you are uploading, if its mp4 or wmv, give it the MIME type, "application/octet-stream", so when a user requests it, it will be delivered by IIS.
No, configure your silverlight app to read the file from your IIS directory (you must be knowing the filename it got saved in IIS in the first place.)
If you need to have a "streaming" experience, IIS won't be enough, you will have to use a streaming server like windows media server or flash media server.
Hope this helps.

Related

pdf not opening in ie in production evironment with load balancer

I have a silverlight application with browsercontrol that needs to use Acrobat PDF Reader to display PDFs in the browser. I am using Acrobat Reader XI and internet explorer as browser. When the application is in the Stage environment everything works fine. However, when the application is in the Production environment pdf does not load or partially loads and stops. There is no difference between the two environments except production environment uses load balancer. The even weirder thing is that Production work and PDF loads when we hit a specific server URL instead of the load balancer URL. Why is it not loading. Why is this happening and better yet, how do I fix it?
Remember that Silverlight is a client technology. While you downloaded the initial site through the load balancer you live then on the client.
So the question is how do you load the pdf within silverlight?
If this is a direct url not through the load balancer the pdf file will not see the load balancer.
If the acrobat reader opens or not depends on the response mime-type and with pdf's this is a disscussion on its own.
Here you find a good stackoverflow question with an answer:
Proper MIME media type for PDF files
HTH

How can I have a config file for Silverlight OOB?

I have a Silverlight application with some appSettings in my Web.Config file. Now I want to make it OOB, what is the best way to handle this.
Should I download config file using WebClient when running in OOB.
Please suggest if you have any good method?
Any "app settings" in a Web.Config are only used by the web/server part of your Silverlight application. Not by the client application (unless you pass them on to the client).
It should not make any difference if your Silverlight App is running OOB... It is still just a client app, requiring information from your web server (if you wish to pass them on).
Basically, you should not need to change anything, unless you are doing something wrong in the first place. Can you explain what sort of settings you are needing in your client application?

Silverlight Open File

If i've got a filepath that the current browsers computer can access. Is there anyway that a silverlight application can open that file?
I dont want to run out of browser if possible as well.
Thanks in advance
In Silverlight 4 OpenFileDialog is the only option to access any place on the file system. Elevated trust, out of browser applications can access the current user folder only. However, in Silverlight 5 this type of application will be able to access anywhere on the file system.
From new features of Silverlight 5 at:
http://www.microsoft.com/silverlight/future/
Silverlight 5 extends features of the
‘Trusted Application’ model to the
browser for the first time. These
features, when enabled via a group
policy registry key and an application
certificate, mean users won’t need to
leave the browser to perform complex
tasks:
Host HTML content as a Web browser
control within the Silverlight
application. HTML pages, such as help
content or e-mail, can be integrated
within the application. Read and write
files to the user’s My Documents
folder, making it easier to find media
files or create local copies of
reports. Launch Microsoft Office and
other desktop programs. Users can open
Microsoft Outlook and create an e-mail
message, or send a report to Word
utilizing the power of Office. Access
devices and other system capabilities
by calling into application COM
components. Users can access a USB
security card reader or a bar-code
scanner. Enjoy full keyboard support
in full screen, which enables richer
kiosk and media viewing applications.
Call existing unmanaged code directly
from within Silverlight with PInvoke.
Note that this feature is available only on the Windows platform.

Silverlight 4 launch a trusted application into the browser?

I just lost 5 hours looking for a answer which i haven't been able to find :p
First, I'd like to force a trusted application (i need to access the file system) to display into the browser. Based on what i found on google a trusted application must be installed and launched as a desktop application (also called out-of-browser application).
So, i want to have an installed application on the client side but meanwhile, the user must also be able to start this same application into a browser window when he goes on my web site. Is this possible ?
Second, I'd like to give to the user the possibility to start the application from the browser. To be clear, the application is installed on the client computer but i want a button on my web site which starts the desktop application. How can i do that ?
Thanks
The answers are sort of and no.
Yes you can run an application that has been installed on the client also in the browser. However, not all of the installed application features will be available. Anything that requires elevated trust will not work inside the browser.
No you can't launch the installed application programmatically from within code running in the browser. The best you can do is display a polite message to the user to the effect that they have this app already installed and in order to access all of its feature they will need to launch it.
Yes, it is possbile since Silverlight 5, see my answer on silverlight-4-elevated-permission-inside-the-browser

Using the EPiServer Communities API from a console app?

I'd like to write a console or winforms application that will interact with the EPiServer database. Since I don't want to muck about in the deep inards of the database I'd like to use the EPiServer API.
However, all the examples are using the "CommunitySystem.CurrentContext" which is null when running outside the website.
Now, I'm going to transfer a large amount of data from a legacy system to EpiServer Community and I really don't want to do that from a web page but from an application I have a little more control of.
Is there any way I can use the API from outside the web context?
I'm not that familiar with the community model. But... I've had no problems at all running huge imports through a web form (or control). The key (besides having disabled execution and database timeouts) has been to run it through Internet Explorer on the site's server and have the site's domain name mapped to 127.0.0.1 in the HOSTS-file. It can run for hours and hours while logging progress to a table or text-file before sending the response.
My colleague Jarle figured out the last bits and blogged the whole process here So if you want to run the EPiServer API outside of IIS, that's the place to start. Works like a charm!

Resources