The new Drupal 6 i18n changes the base url of the video launcher in Video module. Then it is impossible to view the video.

The browser looks at http://www.example.com/fr/files/bin/player where there is no player as the player is in http://www.example.com/files/bin/player (without fr).

What is the new good function to retrieve the base url without suffix? I think it is an already asked question but I'm really not familiar with the API that is why I post here my problem.

The code to launch the player (I think the issue is here):

/**
 * Play videos from in FLV Flash video format
 *
 * @param $node
 *   object with node information
 *
 * @return
 *   string of content to display
 */
function theme_video_play_flash($node) {
  $loader_location = variable_get('video_flvplayerloader', 'FlowPlayer.swf');

  $url = _video_get_fileurl($node->vidfile);
  $file = basename($url);
  $base_url = substr($url, 0, strrpos($url, '/'));

  $height = $node->video_scaled_y + 24; // add commands height

  // this will be executed by not Internet Explorer browsers
  $output = '<!--[if !IE]> <-->
<object type="application/x-shockwave-flash" width="'. $node->video_scaled_x .'" height="'. $height .'"
data="'. url() . check_plain($loader_location) .'">
<!--> <![endif]-->' . "\n";

  // this will be executed by Internet Explorer
  $output .= '<!--[if IE]>
<object type="application/x-shockwave-flash" width="'. $node->video_scaled_x .'" height="'. $height .'"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<![endif]-->' . "\n";

  // params will be passed to both IE or not IE browsers
  $output .= '<param name="movie" value="' . url() . check_plain($loader_location) . '" />
               <param name="wmode" value="transparent" />
               <param name="allowScriptAccess" value="sameDomain" />
               <param name="quality" value="high" />
               <param name="flashvars" value="config={baseURL:\''. $base_url .'\',videoFile:\''. $file .'\',autoPlay:true,bufferLength:5}" />' . "\n"
  . _video_get_parameters($node) .
  '<p>'. t('Your browser is not able to display this multimedia content.') .'</p>
</object>';

  $output = theme('video_format_play', $output, t('http://www.macromedia.com/go/getflashplayer'),
                                      t('Link to Macromedia Flash Player Download Page'),
                                      t('Download latest Flash Player'));
   return $output;
}

Comments

nedjo’s picture

Project: Internationalization » Video
Version: 6.x-1.0 » master
Category: support » bug

Unrelated to i18n, since path rewriting is done by core in D6.

Sounds like a bug in the Video module.

Could try using drupal_get_path(). url() will invoke path rewriting.

rondev’s picture

Status: Active » Fixed

Thank you. I confused i18n and locale of Durpal core.
Finally I used base_path() which works for me.
I publish the correction here:
http://drupal.org/node/248117#comment-1238982

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.