spinners
spinners

Reputation: 2679

Third party video detection with javascript?

I am building an HTML5 video player with a fall back to flash. The problem is that the videos are served by a variety of third parties.

Some of the third parties are serving the video based on user agent.

e.g the url will look like this

http://www.vidserver.com/files/video?key=XXXXXXXXXX

If you are on iOS it will serve mp4, which works fine.

But some third parties are only serving flv to desktop. This means I cannot easily fall-back to flash and will have to force the fall-back with javascript.

Is there a way I can test a url with javascript to determine what video will be served?

Upvotes: 0

Views: 69

Answers (1)

dhc
dhc

Reputation: 657

Can you use a XMLHttpRequest to fetch the page and look at what's returned?

See an example here.

Upvotes: 0

Related Questions