From: <fg...@us...> - 2010-02-13 22:12:27
|
Revision: 1921 http://openutils.svn.sourceforge.net/openutils/?rev=1921&view=rev Author: fgiust Date: 2010-02-13 22:12:21 +0000 (Sat, 13 Feb 2010) Log Message: ----------- MEDIA-91 get original video size for player if not specified + MEDIA-96 controlbar parameter fixed Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player.tag Modified: trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag 2010-02-13 21:26:04 UTC (rev 1920) +++ trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag 2010-02-13 22:12:21 UTC (rev 1921) @@ -45,14 +45,6 @@ <c:choose> <c:when test="${!empty mediaNode}"> <cms:setNode var="media" content="${mediaNode}" /> - <c:set var="controlBar"> - <![CDATA[&controlbar=bottom]]> - </c:set> - <c:if test="${!empty(controlbar)}"> - <c:set var="controlBar"> - <![CDATA[&controlbar=]]>${controlbar} - </c:set> - </c:if> <c:choose> <c:when test="${media.type eq 'image' or media.type eq 'wallpaper' or videoImagePreview}"> <c:choose> @@ -114,7 +106,7 @@ </c:if> </c:when> <c:when test="${media.type eq 'video' or media.type eq 'audio' }"> - <media:player player="${player}" share="${share}" item="${item}" width="${width}" height="${height}" autoPlay="${autoPlay}" loop="${loop}" thumbnail="${thumbnail}" noPlayIcon="${noPlayIcon}" controlBar="${controlBar}" skin="${skin}"/> + <media:player player="${player}" share="${share}" item="${item}" width="${width}" height="${height}" autoPlay="${autoPlay}" loop="${loop}" thumbnail="${thumbnail}" noPlayIcon="${noPlayIcon}" controlbar="${controlbar}" skin="${skin}"/> </c:when> <c:when test="${media.type eq 'youtube'}"> <c:set var="url" value="${media:url(mediaNode)}" /> Modified: trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player.tag =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player.tag 2010-02-13 21:26:04 UTC (rev 1920) +++ trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/player.tag 2010-02-13 22:12:21 UTC (rev 1921) @@ -2,37 +2,67 @@ xmlns:cms="cms-taglib" xmlns:cmsfn="http://www.magnolia.info/tlds/cmsfn-taglib.tld" xmlns:cmsu="cms-util-taglib" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:media="http://net.sourceforge.openutils/mgnlMedia" xmlns:su="http://openutils.sf.net/openutils-stringutils"> - <jsp:directive.tag description="Renders the audio or video player" pageEncoding="UTF-8"/> - <jsp:directive.attribute name="item" required="true" rtexprvalue="true" type="java.lang.Object" description="media uuid or media content node "/> - <jsp:directive.attribute name="player" required="true" rtexprvalue="true" type="java.lang.String" description="the swf file of the player (examples: player.swf (default), jwplayer4, jwplayer5, jwplayer5/player.swf, /.resources/media/players/jwplayer5/player.swf)"/> - <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Integer" description="image or player width"/> - <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Integer" description="image or player height"/> - <jsp:directive.attribute name="ignoreDim" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if true the img element will be rendered without width and height attributes "/> - <jsp:directive.attribute name="autoPlay" required="false" rtexprvalue="true" type="java.lang.Boolean" description="auto starts the player without waiting for user play command"/> - <jsp:directive.attribute name="loop" required="false" rtexprvalue="true" type="java.lang.Boolean" description="loop video or audio"/> - <jsp:directive.attribute name="noPlayIcon" required="false" rtexprvalue="true" type="java.lang.Boolean" description="hide player icons"/> - <jsp:directive.attribute name="skin" required="false" rtexprvalue="true" description="set player skin"/> - <jsp:directive.attribute name="thumbnail" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if set to true the preview of the player shows the thumbnail image"/> - <jsp:directive.attribute name="controlBar" required="false" rtexprvalue="true" type="java.lang.String" description="defines controlbar position. Possible values are: 'none' (for hiding), 'over', 'bottom', 'top'. If not set, this value will be 'bottom' by default."/> - <jsp:directive.attribute name="share" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if set to true the pluging share-1 is showen"/> - + <jsp:directive.tag description="Renders the audio or video player" pageEncoding="UTF-8" /> + <jsp:directive.attribute name="item" required="true" rtexprvalue="true" type="java.lang.Object" + description="media uuid or media content node " /> + <jsp:directive.attribute name="player" required="true" rtexprvalue="true" type="java.lang.String" + description="the swf file of the player (examples: player.swf (default), jwplayer4, jwplayer5, jwplayer5/player.swf, /.resources/media/players/jwplayer5/player.swf)" /> + <jsp:directive.attribute name="width" required="false" rtexprvalue="true" type="java.lang.Integer" + description="image or player width" /> + <jsp:directive.attribute name="height" required="false" rtexprvalue="true" type="java.lang.Integer" + description="image or player height" /> + <jsp:directive.attribute name="ignoreDim" required="false" rtexprvalue="true" type="java.lang.Boolean" + description="if true the img element will be rendered without width and height attributes " /> + <jsp:directive.attribute name="autoPlay" required="false" rtexprvalue="true" type="java.lang.Boolean" + description="auto starts the player without waiting for user play command" /> + <jsp:directive.attribute name="loop" required="false" rtexprvalue="true" type="java.lang.Boolean" + description="loop video or audio" /> + <jsp:directive.attribute name="noPlayIcon" required="false" rtexprvalue="true" type="java.lang.Boolean" + description="hide player icons" /> + <jsp:directive.attribute name="skin" required="false" rtexprvalue="true" description="set player skin" /> + <jsp:directive.attribute name="thumbnail" required="false" rtexprvalue="true" type="java.lang.Boolean" + description="if set to true the preview of the player shows the thumbnail image" /> + <jsp:directive.attribute name="controlbar" required="false" rtexprvalue="true" type="java.lang.String" + description="defines controlbar position. Possible values are: 'none' (for hiding), 'over', 'bottom', 'top'. If not set, this value will be 'bottom' by default." /> + <jsp:directive.attribute name="share" required="false" rtexprvalue="true" type="java.lang.Boolean" + description="if set to true the pluging share-1 is showen" /> <c:set value="${media:node(item)}" var="mediaNode" /> + <c:if test="${empty controlbar}"> + <c:set var="controlbar" value="bottom" /> + </c:if> <c:set var="baseUrl" scope="request"> <jsp:text>${pageContext.request.scheme}://${pageContext.request.serverName}</jsp:text> <c:if test="${(pageContext.request.scheme eq 'http' and pageContext.request.serverPort != 80)}">:${pageContext.request.serverPort}</c:if> </c:set> <c:set var="url" value="${media:url(mediaNode)}" /> <c:if test="${width eq 0 }"> + <c:set var="width" value="${media:width(mediaNode)}" /> + </c:if> + <c:if test="${height eq 0}"> + <c:set var="height" value="${media:height(mediaNode)}" /> + <c:if test="${(controlbar eq 'bottom' or controlbar eq 'top') and height gt 20}"> + <!-- the control bar adds 20px --> + <c:set var="height" value="${height + 20}" /> + </c:if> + </c:if> + <c:if test="${width eq 0 }"> <c:set var="width" value="320" /> </c:if> <c:if test="${height eq 0}"> - <c:set var="height" value="${media.type eq 'video' ? 240 : 20}" /> + <c:set var="height" value="${media.type eq 'audio' ? 20 : 240}" /> </c:if> + <c:set var="previewwidth" value="${width}" /> + <c:set var="previewheight" value="${height}" /> + <c:if test="${previewheight gt 20 and (controlbar eq 'bottom' or controlbar eq 'top')}"> + <c:set var="previewheight" value="${previewheight - 20}" /> + </c:if> <c:if test="${!empty(url)}"> - <c:if - test="${su:endsWith(fn:toLowerCase(url), '.flv') or su:endsWith(fn:toLowerCase(url), '.mp3')}"> + <c:if test="${su:endsWith(fn:toLowerCase(url), '.flv') or su:endsWith(fn:toLowerCase(url), '.mp3')}"> <c:set var="flashvars"> - <![CDATA[file=${pageContext.request.contextPath}${url}${controlBar}]]> + <![CDATA[file=${pageContext.request.contextPath}${url}]]> + <c:if test="${!empty controlbar}"> + <![CDATA[&controlbar=${controlbar}]]> + </c:if> <c:if test="${autoPlay}"> <![CDATA[&autostart=true]]> </c:if> @@ -47,8 +77,8 @@ </c:if> <c:if test="${thumbnail}"> <c:choose> - <c:when test="${width gt 0 and height gt 0}"> - <c:set var="previewres" value="${width}x${height}" /> + <c:when test="${previewwidth gt 0 and previewheight gt 0}"> + <c:set var="previewres" value="${previewwidth}x${previewheight}" /> <![CDATA[&image=${pageContext.request.contextPath}${media:urlres(mediaNode, previewres)}]]> </c:when> <c:otherwise> @@ -60,18 +90,18 @@ <c:set var="sharinglink">${baseUrl}${pageContext.request.contextPath}${actpage.handle}.html</c:set> <c:set var="sharingcode"> <embed src="${baseUrl}${pageContext.request.contextPath}/.resources/media/players/player.swf" - flashvars="file=${baseUrl}${pageContext.request.contextPath}${url}" - width="${width}" height="${height}" /> + flashvars="file=${baseUrl}${pageContext.request.contextPath}${url}" width="${width}" height="${height}" /> </c:set> <![CDATA[&plugins=sharing-1]]> <![CDATA[&sharing.link=${sharinglink}]]> <![CDATA[&sharing.code=${fn:escapeXml(sharingcode)}]]> </c:if> </c:set> - <media:swfobject player="${player}" width="${width}" height="${height}" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="${flashvars}" /> + <media:swfobject player="${player}" width="${width}" height="${height}" allowfullscreen="true" + allowscriptaccess="always" wmode="opaque" flashvars="${flashvars}" /> </c:if> <c:if test="${su:endsWith(fn:toLowerCase(url), 'swf')}"> <media:swfobject player="${pageContext.request.contextPath}${url}" width="${width}" height="${height}" /> </c:if> </c:if> -</jsp:root> +</jsp:root> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |