Music plugin problem

Hi,



Im working on a new music plugin, but im stuck…



An example plugin:



<br />
from PMS import *<br />
PLUGIN_PREFIX   = '/music/test'<br />
<br />
def Start():<br />
  Plugin.AddPrefixHandler(PLUGIN_PREFIX, MainMenu, 'test', '', '')<br />
  Plugin.AddViewGroup("Details", viewMode="InfoList", mediaType="items")<br />
<br />
def MainMenu():<br />
  dir = MediaContainer()<br />
  dir.Append(Function(TrackItem(PlaySong, title="Test Title"), songID="1234"))<br />
  return dir<br />
<br />
def PlaySong(sender, songID):<br />
  return Redirect("http://some_server/some_mp3_file")<br />




The above code gives an "Error while opening file".

But if i change the plugin prefix from "/music/test" to "/video/test" im able to open the stream (But from the video menu...).

Is this a bug, or am i doing something wrong?

Hi!

I ran into a similar problem with the HT Guys podcast plugin, James gave me this tip: add ext=‘mp3’ to the Function, like so:



<br />
  dir.Append(Function(TrackItem(PlaySong, title="Test Title"), ext='mp3', songID="1234"))<br />




This solved my problem, I hope it will help you too!


It worked! Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.