google chrome & subsonic

General discussions.

Moderator: moderators

google chrome & subsonic

Postby zeekay » Tue Sep 02, 2008 10:39 pm

I've been playing with google chrome and it has an option to create application shortcuts (creates a shortcut to website and saves it to your desktop or wherever). The linked to site is then opened in a standard window, appearing like a normal windows application. This is particularly suited for subsonic. I've noticed it's a bit faster than ff3 as well. In terms of integrating with the desktop this is a great step, and quite welcome in my opinion. Overall, chrome is quite nice as well.

http://akindofblue.com/subs0nic_chrome.jpg

http://akindofblue.com/subs0nic_chrome2.jpg

(custom theme)
zeekay
 
Posts: 63
Joined: Sun Aug 03, 2008 6:33 pm

Postby Concept211 » Wed Sep 03, 2008 1:44 pm

Great tip, zeekay!

I've been checking out Google Chrome yesterday and it seems great so far. Performance-wise it's amazing and works great with Subsonic. The only problem is when clicking to play in an external player...it tries to download the playlist file instead of opening it. But I'm sure more features and options will be coming very soon.

Watch out...Google is taking over the world!!!
User avatar
Concept211
 
Posts: 77
Joined: Sat Jul 05, 2008 8:55 pm
Location: Orlando, FL

Postby zeekay » Wed Sep 03, 2008 3:27 pm

I use it with a flash player embedded, so it's basically a self-contained media player, although I have button next to the player which will popup a player in a smaller window. If you want to use a popup player 100% of the time, I'd just code it into playlist.jsp, it's easy to hack it to always do this.

EDIT

I apologize, I guess you were complaining about the way chrome handles playlist files, you actually want to use it with an external media player. I'm more interested in using it AS my media player. ^^
zeekay
 
Posts: 63
Joined: Sun Aug 03, 2008 6:33 pm

Postby Concept211 » Wed Sep 03, 2008 3:58 pm

Yeah, the reason I like using WinAmp as my external player is because I can dock it at the top of my screen and always see who/what's playing at all times.

What would be really cool is if they made Chrome dockable and then have Subsonic update the title tag on the parent frame on every song change so that the Artist and Title would display at all times......just some random thoughts :wink:
User avatar
Concept211
 
Posts: 77
Joined: Sat Jul 05, 2008 8:55 pm
Location: Orlando, FL

Postby potatiking » Thu Sep 18, 2008 8:05 am

Is this a selfmade custom theme?

Is there a possibilty you can share it with us. pls?
potatiking
 
Posts: 19
Joined: Thu Sep 11, 2008 5:26 am

Custom Theme

Postby dalcib » Wed Sep 24, 2008 4:40 pm

How get this custom theme in figure?
dalcib
 
Posts: 2
Joined: Wed Sep 24, 2008 10:43 am

Postby zeekay » Mon Sep 29, 2008 7:04 pm

The theme for subsonic or theme for chrome? You can find various themes for chrome floating around the web, the subsonic theme was made just by modifying the .jsp files/stylesheet/icons, etc in /WEB-INF/jsp, /icons, /style, and I changed the flashplayer to jwplayer (http://www.jeroenwijering.com/). You can change subsonic prettty dramatically but just modifying the .jsp's. If you need help, message me and I'll try to give you further advice. My personal theme probably isn't suitable for you, as a few features I don't use are not accessible/usable with it.
zeekay
 
Posts: 63
Joined: Sun Aug 03, 2008 6:33 pm

Postby twiztar » Fri Oct 10, 2008 12:16 pm

any chance you could paste your code for the alternative player? i've tried some but can't get it to load the playlist..
twiztar
 
Posts: 24
Joined: Fri Oct 10, 2008 12:15 pm

Postby BrianDelShasta » Mon Nov 03, 2008 9:20 am

That is defiantly a well done theme zeekay! About using the JW player...how did you get it to interpret the playlist? What did you use for the flashvars parameter? Any help would be appreciated!

PS - I second the idea of making your customized theme available for others, or even incorporated into future releases of subsonic.

Thanks again
BrianDelShasta
 
Posts: 116
Joined: Tue Jun 03, 2008 4:45 am
Location: USA

Postby zeekay » Wed Nov 05, 2008 3:28 pm

You need to swap out xspf_player in WEB-INF/jsp/webPlayer.jsp. This is fairly easy as both xspf_player (the current flash player) and jw_player use xspf playlists the same way, so jw_player just swaps right in. I'm using the older 3.x version of jw_player because i'm using some of the javascript api that it has (the javascript api was changed and improved a bit, but for my purposes 3.x is easier to work with). just go to http://www.jeroenwijering.com/?item=JW_FLV_Media_Player, grab whatever version you want (the older 3.x is available on the SVN) and read the documentation. There is also a wizard for customizing flashvars: http://www.jeroenwijering.com/?page=wizard. It's pretty straight forward.

Here's what I'm using keep in mind I have a pretty heavily modified version of subsonic, so you'll want to probably just swap out the embed code (I stuck jw_player in the root directory, it's named player.swf):

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1" %>

<html>
<head>
<%@ include file="head.jsp" %>
<title>subs0nic</title>

<c:set var="width" value="400"/>
<c:set var="height" value="150"/>

<link rel="stylesheet" href="style/black.css" type="text/css"/>

<script type="text/javascript" src="<c:url value="/script/scripts.js"/>"></script>

<script type="text/javascript" language="javascript">

function detach() {
popupSize("webPlayer.view?detached=",'player','toolbar=no,statusbar=no,location=no,scrollbars=no,width=400,height=150');
}

</script>

<script type="text/javascript">
var currentItem;

function getUpdate(typ,pr1,pr2,pid) {
if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100); }
};

function getItemData(idx) {
var obj = thisMovie("xspf_player").itemData(idx);
document.getElementById("songinfo").innerHTML = obj["title"];
};

// This is a javascript handler for the player and is always needed.
function thisMovie(movieName) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
};
</script>

</head>

<c:url var="playlistUrl" value="/xspfPlaylist.view">
<%-- Hack to force Flash player to reload playlist. --%>
<c:param name="dummy" value="${model.dummy}"/>
</c:url>

<c:url var="playerUrl" value="player.swf?playlist_url=${playlistUrl}&autostart=true"/>

<c:choose>
<c:when test="${model.detached}">

<body width="400" height="150" onload="window.focus();window.moveTo(300, 200);"style="background: black; margin: 0 auto; padding: 0">

<div style="position: fixed; top: 0; left: 0; width: 395px; height: 140px; margin: 0 auto; padding: 0;">

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"
width="${width}" height="${height}">
<param name="allowScriptAccess" value="sameDomain"/>
<param name="movie" value="player.swf"/>
<param name="quality" value="high"/>
<param name="bgcolor" value="#eee"/>
<embed id="xspf_player" src="player.swf" quality="high" bgcolor="#222222" name="xspf_player" allowscriptaccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"
height="${height}" width="${width}" flashvars="file=${playlistUrl}&autostart=true&frontcolor=0x999999&lightcolor=0xfafafa&backcolor=0x000000&searchbar=false&autoscroll=false&displaywidth=130&overstretch=true&thumbsinplaylist=false&showicons=false&fullscreen=false"></embed>

</object>
</div>

</c:when>
<c:otherwise>

<body onLoad="detach()" class="footer">

</c:otherwise>
</c:choose>

</body>
</html>
zeekay
 
Posts: 63
Joined: Sun Aug 03, 2008 6:33 pm

Postby BrianDelShasta » Thu Nov 06, 2008 9:40 pm

Thanks for the response! However, I am still having trouble. Here is the out of the box (v3.5b2) contents of the webPlayer.jsp file. Keeping it simple, I have replaced the single reference to the old flash player "/flash/xspf_player-0.2.3.swf" with JW Player 4, "/flash/player.swf". Unfortunately, the playlist does not load, it acts like it's empty. I also tried with JW Player v 3, but while the player does react differently, it essentially gives the same result.

I'm not sure if it matters, but if I go to http://subsonicurl/xspfPlaylist.view I get "XML Parsing Error: not well-formed"

Any ideas?


Code: Select all
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1" %>

<html>
<head>
    <%@ include file="head.jsp" %>
    <title>Subsonic</title>

    <c:set var="width" value="600"/>
    <c:set var="height" value="155"/>

    <script type="text/javascript" src="<c:url value="/script/scripts.js"/>"></script>
    <script type="text/javascript" language="javascript">

        function detach() {
            popupSize("webPlayer.view?detached=", 'player', ${width + 20}, ${height + 60});
            location.href = "playlist.view?";
        }

    </script>
</head>

<body class="bgcolor2" <c:if test="${model.detached}">onload="window.focus();window.moveTo(300, 200);"</c:if>>

<c:if test="${not model.detached and not model.default}">
    <table><tr>
        <td style="padding-right:2em"><div class="back"><a href="playlist.view?"><fmt:message key="webplayer.back"/></a></div></td>
        <td style="padding-right:2em"><div class="forward"><a href="javascript:detach()"><fmt:message key="webplayer.detach"/></a></div></td>
    </tr></table>
</c:if>

<c:url var="playlistUrl" value="/xspfPlaylist.view">
    <%-- Hack to force Flash player to reload playlist. --%>
    <c:param name="dummy" value="${model.dummy}"/>
</c:url>
<c:url var="playerUrl" value="/flash/player.swf?playlist_url=${playlistUrl}&autoplay=true&autoload=true"/>

<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="${width}" height="${height}">
    <param name="allowScriptAccess" value="sameDomain"/>
    <param name="movie" value="${playerUrl}"/>
    <param name="quality" value="high"/>
    <param name="bgcolor" value="#E6E6E6"/>
    <embed src="${playerUrl}" quality="high" bgcolor="#E6E6E6" name="xspf_player" allowscriptaccess="sameDomain"
           type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"
           align="middle" height="${height}" width="${width}"></embed>
</object>

<c:if test="${model.detached}">
    <p style="text-align:center;margin-top:1em">
        <a href="javascript:self.close()">[<fmt:message key="common.close"/>]</a>
    </p>
</c:if>

</body>
</html>
BrianDelShasta
 
Posts: 116
Joined: Tue Jun 03, 2008 4:45 am
Location: USA

Postby BrianDelShasta » Thu Nov 06, 2008 10:45 pm

If I set the xspf file to http://www.jeroenwijering.com/upload/xspf.xml (a known working playlist) it works fine.
So I guess the next question is this: is there anything abnormal with the xspf playlists created by subsonic?
BrianDelShasta
 
Posts: 116
Joined: Tue Jun 03, 2008 4:45 am
Location: USA

Postby BrianDelShasta » Thu Nov 06, 2008 11:26 pm

Yeah, I'm not sure how you got JW Player to play the xspf playlist that subsonic generates. I believe you, because I'm probably missing something small here, but here's what I've found so far.

Subsonic generates xspf version 0, jw player preferes version 1 (not a huge deal)

the location parameter specified by subsonic's xspf is a stream (obviously) with no extension. This messes with jw player, since the first thing it seems to do is look for an externsion to determine the file type.

I stripping down the generated xspf to only the stream, forgetting the album art, and then I specified type=mp3 for jw player and the player then get one small stepper further towards being able to read the playlist, but it still doesn't play anything.

I tried all of these with jw player 3.2 as well to no avail. I don't understand what's going on...

Did you make any changes to your xspfPlaylist.jsp file?
BrianDelShasta
 
Posts: 116
Joined: Tue Jun 03, 2008 4:45 am
Location: USA

Postby zeekay » Fri Nov 07, 2008 4:49 pm

You don't need to add an extension to the playlist, you just need to change the xspf playlist a bit:

<%@ include file="include.jsp" %>
<%@ page language="java" contentType="text/xml; charset=utf-8" pageEncoding="iso-8859-1" %>

<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>

<c:forEach var="song" items="${model.songs}">

<sub:url value="/stream" var="streamUrl">
<sub:param name="path" value="${song.musicFile.path}"/>
</sub:url>

<sub:url value="coverArt.view" var="coverArtUrl">
<sub:param name="size" value="200"/>
<c:if test="${not empty song.coverArtFile}">
<sub:param name="path" value="${song.coverArtFile.path}"/>
</c:if>
</sub:url>

<track>
<location>${streamUrl}</location>
<image>${coverArtUrl}</image>
<title>${song.musicFile.metaData.artist} - ${song.musicFile.title}</title>
<meta rel="type">mp3</meta>
</track>

</c:forEach>

</trackList>
</playlist>

One of the nice things I haven't done, but that you can do with jwplayer, is specify a download link for the songs in the playlist (there is a little down arrow that shows up on the player). It just needs to get added into the xspf playlist, and then add the flashvar for the download button to work.

Jw player lets you dynamically add/sort/change the playlist with it's ajax api, I'd like to figure out how to take advantage of that too, at some point.

If you have any other problems I'll try to sort out what else I forgot, :P
zeekay
 
Posts: 63
Joined: Sun Aug 03, 2008 6:33 pm

Postby BrianDelShasta » Sat Nov 08, 2008 6:37 pm

That did it! Thank's alot, this is a pretty fun player to mess aound with the customization on.
My next project is trying to get ffmpeg to transcode and stream video files into flv and play it through jw player.

Thanks again
BrianDelShasta
 
Posts: 116
Joined: Tue Jun 03, 2008 4:45 am
Location: USA

Next

Return to General

Who is online

Users browsing this forum: No registered users and 7 guests