This functionality works in 6.x-1.20. I have been holding off my upgrade since then because it seemed to break my custom embedded URL videos (these are not located in my base root, they are linked to via http://site.domain.com/somevideo.flv).

When I upgraded to the latest security fix for 1.25 my custom videos were broken with a 200 error. The URLs it reports for the videos always have a '/' in front of the http://, for example:

/http://site.domain.com/somevideo.flv

Frustrated, I replaced the entire zzz_custom_url.inc file with the functional one from 1.20 in my install. Everything works now, though I'm worried I may have unintended consequences by replacing the entire file with the old version. Whatever caused the / to be placed in front of the HTTP URL should be reverted.

Comments

frosty29’s picture

I had the same issue, recent module updates have screwed up all my video links.
There is some new code is at line 120 in zzz_custom_url.inc

  if ($url = url($url, array('external' => TRUE, 'absolute' => TRUE))) {
    global $base_path;   #NEW
    $url = $base_path.$url;   #NEW

Where the custom video is internal to the site, CCK ( I suppose, perhaps Emfield) strips out the base path so Emfield tries to put it back in this version. But in my opinion it does it wrong. It uses $base_path, not $base_url? My file is a .flv which gets played at freevideocoding.com so a fully qualified path is required.
I have mucked around with this for too long so put in my own quick fix.

I have created a new type (to save overwriting) called any_video,
(i.e. in /emvideo/providers I put any_video.inc and also in /emvideo/ created emvideo.any-video.css , changing all occurances of zzz_custom_url to any_video and other obvious zzz and custom replacements)
then added these lines from 119 on:

  if ($url = url($url, array('external' => TRUE, 'absolute' => TRUE))) {
#    global $base_path;
#    $url = $base_path.$url;
	if (!(strpos($url,"http://")===0)){
	  if ((strpos($url,"/")===0)) $slash=""; else $slash="/";
	  global $base_url;
	  $url = $base_url.$slash.$url;
	  #echo("Modified Url to $url");
	}

This turns "video/myvid.flv" to "http://www.site.com/video/myvid.flv" which an external site can now access to play.
Quick and dirty, and may not be generic, but has solved my problem and may help someone else.
In addition the new lines here on its own would not have broken my flash video links - I suspect that this was created somewhere else in Emfield or CCK updates in recent weeks, and maybe this is an attempted fix for that which did not work properly? Over to the experts.

alex ua’s picture

Status: Active » Closed (duplicate)

Marking as a duplicate of #639582: Patch to fix custom url link broken when using multi-language path negotiation, which was the issue that caused this problem. Closing this one, please follow up on the other issue.

ball.in.th’s picture

I just ran into this problem in 6.x-1.26 -- video urls have a '/' in front of the http://. Comment out $url = $base_path.$url (line 125), as in #1, fixed my problem.