From: <fg...@us...> - 2010-01-09 17:26:38
|
Revision: 1625 http://openutils.svn.sourceforge.net/openutils/?rev=1625&view=rev Author: fgiust Date: 2010-01-09 17:26:31 +0000 (Sat, 09 Jan 2010) Log Message: ----------- MEDIA-50 New "videoImagePreview" attribute for inserting preview images for videos in media:tag Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag trunk/openutils-mgnlmedia/src/main/resources/mgnl-files/templates/samples-media/paragraph-mediatag.jsp 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-01-09 14:12:10 UTC (rev 1624) +++ trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag 2010-01-09 17:26:31 UTC (rev 1625) @@ -18,7 +18,9 @@ <jsp:directive.attribute name="loop" required="false" rtexprvalue="true" type="java.lang.Boolean" /> <jsp:directive.attribute name="noPlayIcon" required="false" rtexprvalue="true" type="java.lang.Boolean" /> <jsp:directive.attribute name="skin" required="false" rtexprvalue="true" /> - <jsp:directive.attribute name="thumbnail" required="false" rtexprvalue="true" type="java.lang.Boolean" /> + <jsp:directive.attribute name="thumbnail" required="false" rtexprvalue="true" type="java.lang.Boolean" /> + <jsp:directive.attribute name="videoImagePreview" required="false" rtexprvalue="true" + type="java.lang.Boolean" /> <c:set value="${10000}" var="bigValue" /> <c:if test="${empty width }"> <c:set var="width" value="${0 }" /> @@ -34,7 +36,7 @@ <c:when test="${!empty mediaNode}"> <cms:setNode var="media" content="${mediaNode}" /> <c:choose> - <c:when test="${media.type eq 'image' or media.type eq 'wallpaper'}"> + <c:when test="${media.type eq 'image' or media.type eq 'wallpaper' or videoImagePreview}"> <c:choose> <c:when test="${width eq 0 and height eq 0}"> <c:set var="url" value="${media:url(mediaNode)}" /> @@ -129,8 +131,16 @@ <c:if test="${not empty skin}"> <![CDATA[&skin=${skin}]]> </c:if> - <c:if test="${thumbnail}"> - <![CDATA[&image=${pageContext.request.contextPath}${media:thumbnail(mediaNode)}]]> + <c:if test="${thumbnail}"> + <c:choose> + <c:when test="${width gt 0 and height gt 0}"> + <c:set var="previewres" value="${width}x${height}" /> + <![CDATA[&image=${pageContext.request.contextPath}${media:urlres(mediaNode, previewres)}]]> + </c:when> + <c:otherwise> + <![CDATA[&image=${pageContext.request.contextPath}${media:thumbnail(mediaNode)}]]> + </c:otherwise> + </c:choose> </c:if> </c:set> <script type='text/javascript'> @@ -177,10 +187,23 @@ </c:if> <c:set var="flashvars"> <![CDATA[file=${media:url(mediaNode)}&controlbar=over]]> - <c:if test="${fn:indexOf(url, 'youtube') ge 0}"> - <c:set var="previewImage" value="${su:substringAfterLast(url, 'v=')}" /> + <c:choose> + <c:when test="${fn:indexOf(url, 'youtube') ge 0}"> + <c:set var="previewImage" value="${su:substringAfterLast(url, 'v=')}" /> <![CDATA[&type=youtube&image=http://img.youtube.com/vi/${previewImage}/0.jpg]]> - </c:if> + </c:when> + <c:when test="${thumbnail}"> + <c:choose> + <c:when test="${width gt 0 and height gt 0}"> + <c:set var="previewres" value="${width}x${height}" /> + <![CDATA[&image=${pageContext.request.contextPath}${media:urlres(mediaNode, previewres)}]]> + </c:when> + <c:otherwise> + <![CDATA[&image=${pageContext.request.contextPath}${media:thumbnail(mediaNode)}]]> + </c:otherwise> + </c:choose> + </c:when> + </c:choose> </c:set> <c:set var="previewImage" value="${su:substringAfterLast(url, 'v=')}" /> <c:if test="${!empty(url)}"> Modified: trunk/openutils-mgnlmedia/src/main/resources/mgnl-files/templates/samples-media/paragraph-mediatag.jsp =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-files/templates/samples-media/paragraph-mediatag.jsp 2010-01-09 14:12:10 UTC (rev 1624) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-files/templates/samples-media/paragraph-mediatag.jsp 2010-01-09 17:26:31 UTC (rev 1625) @@ -7,8 +7,10 @@ <div> <h3>${media:desc(mediaNode) }</h3> <div> - <pre>&lt;media:media item="${content.media}" width="${content.width}" height="${content.height}" /></pre> - <media:media item="${content.media}" width="${content.width}" height="${content.height}" /> + <pre>&lt;media:media item="${content.media}" width="50" height="30" videoImagePreview="true" /></pre> + <media:media item="${content.media}" width="50" height="30" videoImagePreview="true"/> + <pre>&lt;media:media item="${content.media}" width="${content.width}" height="${content.height}" thumbnail="true"/></pre> + <media:media item="${content.media}" width="${content.width}" height="${content.height}" thumbnail="true" /> </div> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |