Not working with ?q= url

ranavaibhav - May 31, 2008 - 01:44
Project:XSPF Playlist
Version:5.x-0.12
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hello,
i'm unable to get the FLV player working. After viewing the code, i find the file URL is not correct. I'm running test site on localhost and DO NOT have clean URL, any idea??

Here is the sorce:

<div id="flashcontent_mediaplayer_1" >Sorry, you need to install flash to see this content.</div>
<script type="text/javascript" src="/sanatanjagruti/sites/all/modules/swfobject_api/swfobject.js"></script><script type="text/javascript">var so1 = new SWFObject('/sanatanjagruti/sites/all/modules/flvmediaplayer/mediaplayer.swf', 'swf_mediaplayer_1', '320', '240', '5', '#FFFFFF');
so1.addParam('type', 'movie');
so1.addParam('allowfullscreen', 'false');
so1.addParam('allowscriptaccess', 'true');
so1.addVariable('width', "320");
so1.addVariable('height', "240");
so1.addVariable('file', "http://localhost/sanatanjagruti/xspf/node/171");
so1.addVariable('enablejs', "true");
so1.addVariable('allowscriptaccess', "always");
so1.addVariable('shuffle', "false");
so1.addVariable('overstretch', "none");
so1.addVariable('repeat', "list");
$(document).ready(function () { so1.write("flashcontent_mediaplayer_1");}); </script>

#1

ranavaibhav - May 31, 2008 - 01:46

i forgot to say i can see the playlist from below address:
http://localhost/sanatanjagruti/?q=xspf/node/171

#2

ranavaibhav - May 31, 2008 - 02:13
Status:active» fixed

Resolved...Found code from other issue:

USE AT YOUR OWN RISK!! IT WORKED FOR ME...

Replace this code from "xspf_playlist.module"

/**
* builds urls for links to various things
* @param string $path is a path, no starting /
* @return url
*/
function xspf_playlist_url($path) {
  return variable_get('xspf_playlist_base_url', $GLOBALS['base_url']) .'/'. $path;
}

With this

/**
* builds urls for links to various things
* @todo update for D6, url() takes base_url param
* @param string $path is a path, no starting /
* @return url
*/
function xspf_playlist_url($path) {
  static $clean_url;

  // Cache the clean_url variable to improve performance.
  if (!isset($clean_url)) {
    $clean_url = (bool)variable_get('clean_url', '0');
  }

  if(!$clean_url AND substr($path, 0, 5) != 'files'){
    $glue = '?q=';
  } else {
    $glue = '';
  }

  return variable_get('xspf_playlist_base_url', $GLOBALS['base_url']).'/'. $glue . $path;
}

#3

arthurf - May 31, 2008 - 21:40

Hi-

Thanks for being interested in trying to fix a problem. First off, generally supplying a patch is the best way to offer code- if you don't know about patching, you might want to read this: http://drupal.org/patch/create Secondly, it would be good to try to identify what's going on first before trying take apart an admittedly hacky part of a module.

From reading the first post, I think the issue if that swf file thinks it's in a different domain than the xspf playlist. My hunch is that adding the http://localhost/ to the flvmediaplayer setting for the swf file location would resolve this.

Can you try fixing that first, and see if that takes care of the issue?

#4

arthurf - May 31, 2008 - 21:40
Status:fixed» postponed (maintainer needs more info)

Hi-

Thanks for being interested in trying to fix a problem. First off, generally supplying a patch is the best way to offer code- if you don't know about patching, you might want to read this: http://drupal.org/patch/create Secondly, it would be good to try to identify what's going on first before trying take apart an admittedly hacky part of a module.

From reading the first post, I think the issue if that swf file thinks it's in a different domain than the xspf playlist. My hunch is that adding the http://localhost/ to the flvmediaplayer setting for the swf file location would resolve this.

Can you try fixing that first, and see if that takes care of the issue?

#5

nedjo - July 3, 2008 - 17:37
Status:postponed (maintainer needs more info)» fixed

The issue was indeed in xspf_playlist_url(), which assumed clean URLs.

A fix has been included in the refactoring done in http://drupal.org/node/275902.

#6

Anonymous (not verified) - July 23, 2008 - 10:56
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.