Well, you have to put the the trigger in the playAddDownload.jsp file if you only want it to trigger on movies/TV shows. Here is the part of that file that we will be editing:
- Code: Select all
<c:choose>
<c:when test="${param.video}">
<sub:url value="/videoPlayer.view" var="videoUrl">
<sub:param name="path" value="${param.path}"/>
</sub:url>
<a href="${videoUrl}" target="main">
<img src="<spring:theme code="playImage"/>" alt="<fmt:message key="common.play"/>" title="<fmt:message key="common.play"/>"></a>
</c:when>
<c:otherwise>
<a href="javascript:noop()" onclick="top.playlist.onPlay('${path}');">
<img src="<spring:theme code="playImage"/>" alt="<fmt:message key="common.play"/>" title="<fmt:message key="common.play"/>"></a>
</c:otherwise>
</c:choose>
More specifically,
- Code: Select all
<a href="${videoUrl}" target="main">
Just write a javascript script at the top of the page, and insert the ol' "onclick='yourFunction()'.
That's all there is to it.
I actually have it running a script when a video is played. However, I have the script in the playlist.jsp file, so I just reference it using "onclick='top.playlist.myFunction()'".
Hope this helps!