Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alec Colebrook-Clark 134 posts 258 karma points
    Aug 11, 2009 @ 10:31
    Alec Colebrook-Clark
    0

    Best Practices - Video Content

    Hey All,

    Im creating a document type to hold video content. Now I'm considering how this document type should be used. Should i hold it underneath a content node and use a macro to pull it through or should i include some fields of the content document type and use it as a seperate page?

    Cheers

    Alec

  • dandrayne 1138 posts 2262 karma points
    Aug 11, 2009 @ 11:02
    dandrayne
    0

    The way I usually do it is to store videos in the media library, then use a macro to allow the author to insert them on a page from within the wysiwyg.  Using flowplayer (http://flowplayer.org/) this is made pretty easy and the result looks good.

    Heres some xslt that will allow the user to pick (one) video from the media library and write it out using flowplayer (*the flowplayer and jquery js would need to be included in your template)

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">


    <xsl:output method="html" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:variable name="videoHeight" select="/macro/videoHeight" />
    <xsl:variable name="videoWidth" select="/macro/videoWidth" />

    <!--
    <xsl:variable name="videoName" select="umbraco.library:GetMedia(/macro/videoName, 'false')/data [@alias = 'umbracoFile']" />
    -->
    <xsl:template match="/">
    <a href="{/macro/videoName/node/data [@alias='umbracoFile']}"
    style="display:block;width:{$videoWidth}px;height:{$videoHeight}px;"
    id="player">
    </a>
    <script type="text/javascript">
    //<![CDATA[
    flowplayer("player", "/scripts/flowplayer-3.1.1.swf", {
    clip: {
    autoPlay: false,
    autoBuffering: true
    }
    });
    //]]>
    </script>


    </xsl:template>

    </xsl:stylesheet>

    This goes in to a macro with three params

    videoHeight
    videoWidth (these allow the user to adjust for the video)
    videoName - (using mediacurrent)

    If you wanted instead to build up pages with many movies, you could simply set a sensible default for width and height and use a multiple media picker on a page to build up a gallery.

    Dan

  • Tom Maton 387 posts 660 karma points
    Aug 11, 2009 @ 12:42
    Tom Maton
    0

    If you are using multiple videos on one page then you will have to be careful in regards to the id="player" as if you have the id referenced more that once then obviously it will fail the XHTML validator and flowplayer will go into one and not work correctly.

    You would have to use classes and create dynamic id's so the correct video is played.

    Tom

  • Alec Colebrook-Clark 134 posts 258 karma points
    Aug 11, 2009 @ 13:25
    Alec Colebrook-Clark
    0

    Thanks for the detailed answer, however i have forgot to mention that i am using the video embed package. Sorry to waste your time. I must admit i'm very tempted to give this a try!

    thanks

    Alec

Please Sign in or register to post replies

Write your reply to:

Draft