Add Revolt plugin to /share page

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

Add Revolt plugin to /share page

Postby danobegood » Sun Dec 11, 2011 2:44 pm

I thought the coverart display on the share page was a bit basic so I figured I'd try to figure out how to insert the Revolt plugin. If you wish modify the code in the

subsonic\jetty\2583\webapp\WEB-INF\jsp\externalPlayer.jsp

page as listed below in bold, the Revolt plugin will display on the share page instead of coverart

<%--@elvariable id="model" type="java.util.Map"--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1" %>

<html>
<head>
<%@ include file="head.jsp" %>
<script type="text/javascript" src="<c:url value="/script/swfobject.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/prototype.js"/>"></script>

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

<meta name="og:title" content="${fn:escapeXml(model.songs[0].metaData.artist)} &mdash; ${fn:escapeXml(model.songs[0].metaData.album)}"/>
<meta name="og:type" content="album"/>
<meta name="og:image" content="http://${model.redirectFrom}.subsonic.org${coverArtUrl}"/>

<script type="text/javascript">
function init() {
var flashvars = {
id:"player1",
plugins:"revolt.swf",
screencolor:"000000",
frontcolor:"<spring:theme code="textColor"/>",
backcolor:"<spring:theme code="backgroundColor"/>",
stretching: "fill",
"playlist.position": "bottom",
"playlist.size": 200
};
var params = {
allowfullscreen:"true",
allowscriptaccess:"always"
};
var attributes = {
id:"player1",
name:"player1"
};
swfobject.embedSWF("<c:url value="/flash/jw-player-5.6.swf"/>", "placeholder", "500", "500", "9.0.0", false, flashvars, params, attributes);
}

function playerReady(thePlayer) {
var player = $("player1");
var list = new Array();

<c:forEach items="${model.songs}" var="song" varStatus="loopStatus">
<sub:url value="/stream" var="streamUrl">
<sub:param name="path" value="${song.path}"/>
<sub:param name="player" value="${model.player}"/>
</sub:url>
<sub:url value="/coverArt.view" var="coverUrl">
<sub:param name="size" value="500"/>
<c:if test="${not empty model.coverArts[loopStatus.count - 1]}">
<sub:param name="path" value="${model.coverArts[loopStatus.count - 1].path}"/>
</c:if>
</sub:url>

<!-- TODO: Use video provider for aac, m4a -->
list[${loopStatus.count - 1}] = {
file: "${streamUrl}",
image: "${coverUrl}",
title: "${fn:escapeXml(song.title)}",
provider: "${song.video ? "video" : "sound"}",
description: "${fn:escapeXml(song.metaData.artist)}"
};

<c:if test="${not empty song.metaData.duration}">
list[${loopStatus.count-1}].duration = ${song.metaData.duration};
</c:if>

</c:forEach>

player.sendEvent("LOAD", list);
player.sendEvent("PLAY");
}

</script>
</head>

<body class="mainframe bgcolor1" style="padding-top:2em" onload="init();">

<div style="margin:auto;width:500px">
<h1 >${model.songs[0].metaData.artist}</h1>
<div style="float:left;padding-right:1.5em">
<h2 style="margin:0;">${model.songs[0].metaData.album}</h2>
</div>
<div class="detail" style="float:right">Streaming by <a href="http://subsonic.org/" target="_blank"><b>Subsonic</b></a></div>

<div style="clear:both;padding-top:1em">
<div id="placeholder">
<a href="http://www.adobe.com/go/getflashplayer" target="_blank"><fmt:message key="playlist.getflash"/></a>
</div>
</div>
<div style="padding-top: 2em">${fn:escapeXml(model.share.description)}</div>
</div>
</body>
</html>
danobegood
 
Posts: 26
Joined: Mon Nov 29, 2010 3:12 pm

Re: Add Revolt plugin to /share page

Postby ratsark » Thu Dec 15, 2011 6:07 pm

What does the revolt plugin do? Is there an explanatory link you could provide? A quick Google search didn't turn up anything useful.
ratsark
 
Posts: 4
Joined: Thu Dec 08, 2011 5:51 pm

Re: Add Revolt plugin to /share page

Postby danobegood » Sun Jan 01, 2012 4:04 pm

ratsark wrote:What does the revolt plugin do? Is there an explanatory link you could provide? A quick Google search didn't turn up anything useful.

it provides a screen visualization, similar to winamp visualizer. Normal display is rather insignificant, but right clicking on it and selecting fullscreen allows for a timed visualizer to the music that is playing.
This image shows a very small view of the revolt plugin. Its a small horizontal stripe of blue just above the 00:27 time display
Image

If you change to fullscreen you'll get a display similar to what you see below, naturally, in fullscreen
Image

The share page would show the revolt plugin like this
Image
danobegood
 
Posts: 26
Joined: Mon Nov 29, 2010 3:12 pm

Re: Add Revolt plugin to /share page

Postby rfunderburk » Tue Jan 24, 2012 3:30 am

Nice, I like this!
rfunderburk
 
Posts: 7
Joined: Sat Jan 07, 2012 11:35 pm

Re: Add Revolt plugin to /share page

Postby Megamorf » Sun Apr 07, 2013 10:12 pm

Is there a reason why this neat visualizer is only available when sharing music? :o
Megamorf
 
Posts: 18
Joined: Sun Aug 07, 2011 11:51 am

Re: Add Revolt plugin to /share page

Postby danobegood » Wed Nov 20, 2013 12:37 am

Megamorf wrote:Is there a reason why this neat visualizer is only available when sharing music? :o

see my older post
viewtopic.php?p=17562#p17562
danobegood
 
Posts: 26
Joined: Mon Nov 29, 2010 3:12 pm


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 6 guests