Reputation: 1528
I have a WPF WebBrowser object in my application in which I am trying to view an isolated YouTube video. Every time the WebBrowser navigates to this YouTube video, I (the user) am presented with a dialog box stating the following:
File Download - Security Warning
Do You Want to Open or Save this file?
Is there any way to avoid this dialog? The address I am using for the YouTube video is formatted like this (for example):
http://www.youtube.com/v/EVCkSMwaGGc&hl=en&fs=1&
Upvotes: 0
Views: 1955
Reputation: 335
Well. the WPF browser is simply a wrapper around internet explorer. If you try navigating to the same URL in IE, you´ll find that it behaves exactly the same way.
What you probably need to do is generate a string something like the following: "" and load that instead.
Upvotes: 0
Reputation: 15823
I think this problem is not related to WPF or WebBrowser control. If you sniff traffic from YouTube you find that content-type is application/x-shockwave-flash. It looks like IE reacts on this content type with Save file dialog.
But what you can do is create a standalone html and refer it to the video you are trying to show. Something like this:
<html>
<head>
<title>YouTube Video</title>
</head>
<body>
<object height="100%" width="100%">
<param name="movie" value="http://www.youtube.com/v/8VQ4f22-SeE&hl=ru&fs=1&">
</param><param name="allowFullScreen" value="true">
</param><param name="allowscriptaccess" value="always">
</param>
<embed src="http://www.youtube.com/v/8VQ4f22-SeE&hl=ru&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="100%" height="100%">
</embed>
</object>
</body>
</html>
Note, original video from your post cannot be embeded, because of permissions.
PS: To see the actual traffic I'm using FireFox + FireBug.
Upvotes: 3