contao/import — Issue #3260: Play certain files from other domains in Mediabox
Author: importer
Created: 2011-11-29 21:13:32+00:00
State: open
Labels: Defect, plugins

Depending on the Contao patch in mediabox.js it is afaik not possible to play .flv, .mp4, .mp3 or .aac files from other domains:

```
// PATCH: use relative URLs to bypass the .htaccess protection
var uri = new URI(URL);
URL = "../../" + uri.toRelative(); // <= results in ../../http://www.somewhere...
// PATCH EOF
```

If this patch still is necessary, wouldn't it be a more specific approach to enhance it to:

```
// PATCH: use relative URLs to bypass the .htaccess protection
var uri = new URI(URL).toAbsolute();
if (uri.charAt(0) === '/') {
URL = "../../" + new URI(uri).toRelative();
} else {
URL = uri;
}
// PATCH EOF
```

--- _Originally created by b2m on July 12th, 2011, at 10:32pm (ID 3260)_