Page 1 of 1

Add Revolt plugin to /share page

PostPosted: Sun Dec 11, 2011 2:44 pm
by danobegood
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>

Re: Add Revolt plugin to /share page

PostPosted: Thu Dec 15, 2011 6:07 pm
by ratsark
What does the revolt plugin do? Is there an explanatory link you could provide? A quick Google search didn't turn up anything useful.

Re: Add Revolt plugin to /share page

PostPosted: Sun Jan 01, 2012 4:04 pm
by danobegood
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

Re: Add Revolt plugin to /share page

PostPosted: Tue Jan 24, 2012 3:30 am
by rfunderburk
Nice, I like this!

Re: Add Revolt plugin to /share page

PostPosted: Sun Apr 07, 2013 10:12 pm
by Megamorf
Is there a reason why this neat visualizer is only available when sharing music? :o

Re: Add Revolt plugin to /share page

PostPosted: Wed Nov 20, 2013 12:37 am
by danobegood
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