Embeding a flash based player

Need help? Post your questions here.

Moderator: moderators

Embeding a flash based player

Postby njdude » Sun Jun 25, 2006 4:13 am

Hi,
Is there a way to use or embed a flash based player like the opensource XSPF or wimpy with subsonic ?

Would appreciate if someone can tell me how i can go about doing this.

Thanks
njdude
njdude
 
Posts: 1
Joined: Sun Jun 25, 2006 4:10 am

Postby sindre_mehus » Mon Jun 26, 2006 9:31 am

Hi,

You can try to hack Subsonic by adding the following code to (for instance) top.jsp (located in TOMCAT_HOME/webapps/subsonic/WEB-INF/jsp).

Remember to change "song_url", both occurences, to point to your server.

Code: Select all
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="400" height="15" id="xspf_player" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="http://musicplayer.sourceforge.net/xspf_player_slim.swf?song_url=http://yourhostname/subsonic/stream&song_title=Subsonic" />
<param name="quality" value="high" />
<param name="bgcolor" value="#e6e6e6" />
<embed src="http://musicplayer.sourceforge.net/xspf_player_slim.swf?song_url=http://yourhostname/subsonic/stream&song_title=Subsonic" quality="high" bgcolor="#e6e6e6" width="400" height="15" name="xspf_player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>


-Sindre
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby therequiem » Mon Jul 10, 2006 6:03 pm

Hey Sindre

I put the code above into the top file and got it "working" but ran into a couple of problems:

- Instead of just streaming the current audio to play, subsonic would pump the playlist to the flash player at full upload speed. (ie, track was ~192 kbps but subsonic was uploading at a full 800kbps)
- This lead to the playlist not functioning correctly (the wrong track was highlighted, and switching tracks did not work as expected)
- finally, this eventually caused the player or stream [im not sure which it was] to fail. I tried to figure out when this crashed occured to help debug, but it was inconsistent. I had the impression that the stream stopped after the playlist was fully transferred (but not yet played) though I found some instances where this was not the case.

Just my $0.02 on experience using this flash player.
therequiem
 
Posts: 8
Joined: Mon Jul 10, 2006 5:53 pm
Location: Toronto, Ontario, Canada

Postby matthew » Fri Jan 26, 2007 5:03 pm

Sindre,

I downloaded and installed the xspf player locally then changed/added the code to my top.jsp file,

I can see the player however streams are still spawning in Windows Media Player. It is possible to just use the xspf player?

Thanks
Matthew.
matthew
 
Posts: 59
Joined: Thu Jan 25, 2007 9:59 pm
Location: USA - Glendora, Californina

Postby sindre_mehus » Sun Jan 28, 2007 1:49 pm

Hi Matthew,

You can try to turn off "Control player automatically" in Settings > Players.

Sindre
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby matthew » Sun Jan 28, 2007 4:34 pm

sindre_mehus wrote:Hi Matthew,

You can try to turn off "Control player automatically" in Settings > Players.

Sindre


I tried that as well. It is still spawning in Windows Media Player. :(
matthew
 
Posts: 59
Joined: Thu Jan 25, 2007 9:59 pm
Location: USA - Glendora, Californina

Postby sindre_mehus » Sun Jan 28, 2007 5:42 pm

Really? Can you please double-check that you selected the proper player (in the combo box at the top) in Settings > Players?

Cheers,
Sindre
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby matthew » Sun Jan 28, 2007 9:53 pm

sindre_mehus wrote:Really? Can you please double-check that you selected the proper player (in the combo box at the top) in Settings > Players?

Cheers,
Sindre


Yep, that was the problem. Thanks. However, I think I am having the same problems as therequiem was above.
matthew
 
Posts: 59
Joined: Thu Jan 25, 2007 9:59 pm
Location: USA - Glendora, Californina

Postby matthew » Wed Aug 15, 2007 9:19 pm

Sindre,

Is it possible to get xspf fully integrated into subsonic so that album art, and playlist information gets loaded into the xspf player. Similar to how Ampache, has it setup.

see http://www.ampache.org/forums/t1299-How ... pf%29.html

Thanks,
Matthew.
matthew
 
Posts: 59
Joined: Thu Jan 25, 2007 9:59 pm
Location: USA - Glendora, Californina

Postby sindre_mehus » Fri Aug 17, 2007 8:03 pm

Hi Matthew,

Thanks for the link. I'll read thru it when I get time, and see if something similar can be done in Subsonic.

Sindre
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby sindre_mehus » Sat Aug 25, 2007 4:37 pm

Just a quick update: I did some brief testing of the xspf player yesterday and it seemed to work satisfactorily, so I hope to include support for it in the next beta version.

Thanks :-)
Sindre
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby matthew » Sun Aug 26, 2007 4:58 am

OoOoO. Sweet! When do you anticipate releasing the beta? This was the only feature subsonic was lacking. Also, can you add the ability to allow only the flash player to be used?

Thanks again for all of your effort!
Matthew.
matthew
 
Posts: 59
Joined: Thu Jan 25, 2007 9:59 pm
Location: USA - Glendora, Californina

Postby sindre_mehus » Sun Aug 26, 2007 6:55 pm

I hope to release the beta within a few weeks. I was planning to make it quite simple in the first version, with an option in the playlist frame to open the current playlist in the flash player.

To disable auto-launch of other players (Winamp, WMP etc), you can turn off "Control player automatically" as discussed earlier in this thread.

The major drawback of the flash player is that you can't modify its playlist after it's been started. (At least I haven't found a way to do it).

Sindre
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby matthew » Mon Aug 27, 2007 8:04 pm

sindre_mehus wrote:
The major drawback of the flash player is that you can't modify its playlist after it's been started. (At least I haven't found a way to do it).



Hmm. That sucks.
matthew
 
Posts: 59
Joined: Thu Jan 25, 2007 9:59 pm
Location: USA - Glendora, Californina

Postby MaRINoL » Sat Sep 22, 2007 6:31 pm

Sindre,

Today I installed 3.2 Beta 1 to try out the embedded player. I have found that I am unable to get it working in any of the browsers I have tried (Opera, Firefox, IE) with automatic player control disabled on the appropriate player. When I attempt to play a song, nothing happens at all. There is, however, an entry placed in the log under "help" to indicate that a stream had begun. I noticed that IE points to an error on the page-

Line: 114
Char: 9
Error: Object doesn't support this property or method.
Code 0

I have also tried saving/loading the playlist in xspf format with the same result.

Might you be able to point out what I am missing?
MaRINoL
 
Posts: 4
Joined: Sat Sep 22, 2007 6:16 pm

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 26 guests