When I set up my Drupal-based website I discovered that Flashy player
didn't work for languages other than English because the player was
trying to download non-existing url like

http:////sites/default/files/test.m4v

rather than

http:///sites/default/files/test.m4v

The quick fix follows but it is rather hard-coded to use English. I
though that you would probably like to apply a generic fix for this
issue and put it into the project's code.

Thanks,

Alex.

File: flashy.wrapper.inc

/**
* Gets the path to the file, as a fully qualified path.
*
*/
public function getMediaUrl() {
if ($this->playlist) {
return url($this->playlist, array('absolute' => TRUE));
}
if (count($this->paths) > 1) {
// Do something with dynamic playlists.
}
else {
return url($this->paths[0], array('absolute' => TRUE, 'language' =>
'en')); // fix for multilingual setup
}
}

CommentFileSizeAuthor
#2 flashy-file_create_url.patch850 bytesfloretan

Comments

svet007’s picture

Sorry this should look like the following:

When I set up my Drupal-based website I discovered that Flashy player
didn't work for languages other than English because the player was
trying to download non-existing url like

http://[domain]/[lang]/sites/default/files/test.m4v

rather than

http://[domain]/sites/default/files/test.m4v

The quick fix follows but it is rather hard-coded to use English. I
though that you would probably like to apply a generic fix for this
issue and put it into the project's code.

Thanks,

Alex.

File: flashy.wrapper.inc

/**
* Gets the path to the file, as a fully qualified path.
*
*/
public function getMediaUrl() {
if ($this->playlist) {
return url($this->playlist, array('absolute' => TRUE));
}
if (count($this->paths) > 1) {
// Do something with dynamic playlists.
}
else {
return url($this->paths[0], array('absolute' => TRUE, 'language' =>
'en')); // fix for multilingual setup
}
}

floretan’s picture

Category: feature » bug
Status: Active » Needs review
StatusFileSize
new850 bytes

file_create_url() should be used instead of url(), leaving the URL unaffected by language prefixes or PURL.

This should also solve #733260: Open Atrium PURL base URL problem.