.NET WebBrowser: Retrieve all videos to play on any given web page - c#

I am involved in an opportunity for which I have been tasked to write a "spider" application whose goal is to dynamically crawl a predefined set of web pages and/or specific URIs and retrieve as many videos as possible either playing on the page or scheduled to play on the page. The goal here is to collect advertising, which is generally not encrypted, so this is not a question about decrypting streamed content or anything in that direction.
We have attempted various solutions, e.g.:
Employing a HTTP Session analysis tool like Fiddler and using a Fiddler extension I wrote to transmit any HTTP sessions that look like video (FLV, MPEG-4, various hints in the URL/headers/etc.) to a separate aggregator application via WCF;
Scanning every single ASCII text file transmitted during the spidering session for URLs to video files, and investigating them/downloading them one at a time before transmitting them to the aggregator application;
etc.
Unfortunately the coverage with these solutions has been less than satisfactory; for some sites, we get absolutely none of the videos; other sites, we get some, and for very few sites we get all of them.
Especially frustrating are sites whose browser must be in focus for any videos to play, or sites where a "play" button must be clicked before any videos will load or play, or sites where the video content must be visible AND in focus before any videos will load or play, etc. It is not very efficient to run only a single spider per server to collect these videos.
As stated, we are using a C# .NET Winforms solution hosting a WebBrowser control. Perhaps there are better components out there? Any suggestions appreciated, though we would very much like to stay within the .NET world (third-party components that work well with .NET interop are fine obviously).
Thanks for any information!

Related

What's the best way to display on a browser running on a computer/tablet/cell a video stored on my IIS server

I storing some videos on my IIS server and would like to now display them on a browser. I'm aware that HTML5 has a video tag, but don't know how many browsers can use that. I'm also open to use a 3rd party tool (if needed).
The videos will need to display on the major browsers running on a computer, tablets and cellphones.
Sorry, one last point.
The videos are currently encoded as h264 and their size are between 50k and 200k.
Any help will be truly appreciated.
Almost all major browsers support the html5 video element at this point. There's a matrix available on caniuse.com.
The only browsers of note that don't support it are IE8 and Opera Mini, which is a pretty short list.
When it comes to streaming video, I always recommend distributing the video via Vimeo, it's super easy, and the player can be customised to a degree. Streaming the video on your own server just sucks up your bandwidth. Vimeo can take away all those network/mime type issues, they'll even deliver a customised experience depending on your browser, you'd have to do all that yourself if you were delivering it via your own website.

Custom controlls and next and previous buttons for an embedded quicktime movie player

I'm currently working on a website project in asp.net that hosts videos in many different languages. They are in a series of 12 videos so I'd like to be able to embed one video player on the web page and then be able to click a next button and the next video in the list would play. I'd also like to be able to do the save thing with a previous button as well. Also is there a way to play and pause the video with custom controls? I did some research on it and I found some answers in Javascript but then I went to the apple documentation and it said you can no longer use it due to security reasons.
Does anyone have any solutions for any of these? Preferably in asp.net C# but anything will help. Thanks!
This should be doable using the code on apple's website. In fact, I just tried it using ordinary anchor hyperlinks to play and pause a movie. Works fine. Didn't try loading a new url, but it should work too. The security restriction only applies to calling javascript from a QuickTime movie. (Which btw can still be achived using an iframe).

C# mute/unmute specific window/s?

I would like to know if it is possible to mute only a specific window. For example I have got Firefox open and two more windows. I want to mute everything related to Firefox but not the whole sound of my computer.
Is this possible? If so, how can it be done?
look, basically, there isn't any relation between the window handle and the sound which something in its code is playing.. the audio card can't tell who wants it to play.
theoretically, there is an option to do what you want on web browsers, but it's not easy, and not 100%. it goes like this:
most of the audio that is playing from browsers are from known objects like wmp/quick time/vlc/flash/etc..
when the user will choose to mute all audio from firefox, your application will search those known objects in the firefox tabs, and mute/unmute them using their api.
in order to do that, you will need to write an extension to firefox, so you could have an access to the tabs memory from your application.
btw, what os?
and check this out: http://www.indev.no/?p=projects#flashmute (flashmute) i believe it does what is said - only for flash.
On Vista/Windows 7:
I expect there to be some API which can change the volume on a per process basis which the audiomanager uses. Should be relatively straight forward to use.
On XP
I don't think there is any built in functionality for what you want to do. I recommend just not offering that feature on XP. But if you really want to, there are some hackish solutions:
Usermode API hooking. Intercept the calls to audioapis with your own functions. These change the volume or manipulate the audiosignal so you get what you want. You need to do this differently for any of the several available audio-apis. I guess DirectSound and DirectShow are particularly annoying. And this requires injection of a dll into any process you want to manipulate. And this dll better not require the .net runtime. Search for IAT(import address table) or EAT(export address table) hooking.
Kernel mode audio hooking. Write a driver which intercepts the audio in the kernel and changes it on a per process basis. No clue how to do that.
But as you can see both solutions aren't good.

Tips for designing web pages for mobile browser?

I'm making my debut in designing a web app specifically targeted at mobile browsers. While I've written web pages before in C#/ASP.NET, I've never done anything specifically for the limited screen real estate and other idiosyncrasies of mobile browsers. So I'm looking for some pointers here:
What design considerations should I be taking account of (aside from the obviously smaller screen)?
What useful features are there in C# that can be put to good effect for the mobile client?
How do you make sure to give a relatively uniform user experience for all different mobile browsers?
Any other tips you have?
Thanks!
Probably obvious but make sure you define a bespoke handheld stylesheet.
<link rel="stylesheet" href="http://domain.tld/mobile.css" type="text/css" media="handheld" />
Whilst modern smartphones (e.g. iPhone) can handle normal sites the constant zooming in and out is better avoided for a dedicated mobile app. However, it's worth designing two versions in case the user wants to access the app using a laptop / desktop too.
What design considerations should I be
taking account of (aside from the
obviously smaller screen)?
How about the user interaction, for example there are few devices that allow for "hovering", so don't depend on psuedo-classes that cannot be emulated on a mobile device, but don't completely ignore them, so mobile devices may use them.
Think about orientation of the design, if the device supports landscape and horizontal viewing.
Some devices like the iPhone cannot be operated to a mm accuracy using a stylus, so don't make inputs dangerously small.
If using effects to tart up the UI, most mobile devices don't display effect (such as those provided by jQuery) very well...
Finally test, test, test! Test on as many real mobile devices you can, and when you're done consider using emulators (such as ones for BlackBerrys or the iPhone), whilst this won't provide you with the feel of using the device, it should show any rendering problems.
Making a good mobile device experience is mostly about the UI, and not the back end application.
Use a mobile device style sheet (media="handheld" attribute on the link-element)
Have as few HTTP-requests as possible:
Compress all scripts and stylesheets into one single file (one for .js, one for .css, that is)
As few images as possible
Keep in mind the differences between touch devices and non-touch devices (size of buttons, for example)
Be careful with the amount of content you fit into one page.
Compress, minifying, optimize for a couple of reasons. Bandwidth isn't great, a page that loads in a couple of seconds on the desktop could take 30+ seconds on a mobile device. Caching is really poor on mobiles. An example being the iPhone will not cache components of a website over 25k. So get your images, scripts, stylesheets as small as possible.
You should check out WURFL which basically is a huge xml file that helps you identify the device. You grab the user agent and check it against the file with their API to get all the capabilities and features for that device. I´ve used it in numerous projects with great success.
Don't redirect to the mobile version of the site, losing the intended target. If I want to view an article on a site, don't take me to the mobile home page. You may take me to the mobile view of the article, but hijacking my target entirely is unacceptable.
A certain cr***ed.com does this always which is incredibly infuriating....

dynamic loading in silverlight

Ill explain a little bit of my project here. I'm trying to make a website in silverlight, my goal is to store all the content in external files, and load them after my silverlight app has loaded. for instance, load the home page, then, while the user is browsing the home page, load the other pages in the backround, and then when a link is clicked, the main content will fade out, and the new page will then fade in its place. My question to you guys is:
whats the best way to create the external files? how should they be created/saved?
how can i load them in the backround while the user is browsing, and then display them by fading when a link is clicked?
how can i add features, for my silverlight app to edit, and re-save the files,for instance, adding a picture to a picture gallery and such
any help would be greatly appriciated. the code-behind of my app is in C#, but im new with the whole silverlight idea, so pretty much any advice at this point would be very welcomed!!
My suggestion for this scenario is using a MEF (Managed Extensibility Framework).
It's provide Dynamically Loading a .XAP, Downloading Based on User Interaction, and other's features out of the box. So, I think, use the MEF it's easyest way approach load-content-on-demand scenario.
You don't mention what sort of content you are dealing with. If it's markup (markdown) and images it should be pretty simple
Log every actual content request, and use that data to rank the order you pre-load the cache in. This way the system is self tuning. If there are complex paths to traverse, consider using a neural network process to determine what to pre-load
Silverlight uses the standard browser HTTP request methods and hence cache, so all you have to do is request a resource and it will be cached
You seem to be describing a wiki (editing pages in Silverlight etc). Consider using an existing wiki engine e.g. screwturn.eu and customising the display and editing interface to work via Silverlight. This will save an enormous amount in versioning, resource management, security etc
Similar to the Managed Extensibility Framework which FFire mentioned, you may also want to look into Prism V2. Heres some resources to get you started and find out if its for you.
WPF/Silverlight - Prism - Resources for beginners
from that list heres a good list of example videos about silverlight, modularity, regions etc.

Categories

Resources