I making a script to convert all wmv avi mp3 wav mp4 etc links to play with the embedded jwplayer. The player loads but doesn’t play the video and instead displays the following error: Task Queue failed at step 5: Playlist could not be loaded due to cross-domain policy restrictions.
Searching online led me to realize that I need to have a file named crossdomain.xml or something like that hosted. Now since this is a script that is meant to run on any site I obviously can’t do that.
I thought of maybe inlining the entire player in a data uri. I tried that too like so: DEMO
This is the site that I took the player from: http://player.longtailvideo.com/player.swf
Is what I’m trying to do possible? I imagine it works like a data uri for an img. Am I missing something?

Data URIs do not work on
<object>or<embed>nodes. That is whyGM_getResourceURL()will not work for this either.Further, when using the direct
<embed>method theplayer.swffile must reside on the same domain as the video or cross-site security will block the video load. This particular block may be built into this particularplayer.swf.However, when using Longtailvideo’s
jwplayer.setup ()function (which they recommend anyway), the player seems to work.You have to use a hosted version of the player, but luckily one is provided at
http://player.longtailvideo.com/player.swf.It will give an
NetworkError: 404 Not Found - http://someSite/crossdomain.xmlerror, but the video will play.Here’s a sample GM script that works:
Warnings:
Certain media types (or that player) seem to have extra XSS “protection” built in. This means that
.wmvfiles will not work, for example, while many.mp4files do.The video file apparently must be in the exact same domain for this player. So target page
foo.com\somepage.htmcontaining a videofoo.com\somevid.mp4will (usually) work, but if the video iscdn.foo.com\somevid.mp4, it won’t work.The only foolproof way to use this player, remains these two options:
Write your own Firefox addon that does not have the restriction against patching local files (
player.swf), cross-domain, into the page. You could fork off of Greasemonkey or Scriptish code.Have your GM script AJAX the video to your own server (which can be your local machine running XAMPP, etc.). Then said machine will serve the video and
player.swfback to you, possibly in an<iframe>.