Copied to clipboard

Flag this post as spam?

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


  • Lister 32 posts 52 karma points
    Nov 05, 2010 @ 06:11
    Lister
    0

    Playing JW Player in Umbraco?

    Is there a package or a way to play JW Player videos on Umbraco?

    All advice greatly appreciated thanks!!

  • Rik Helsen 670 posts 873 karma points
    Nov 05, 2010 @ 09:47
  • Ian Smedley 97 posts 192 karma points
    Nov 05, 2010 @ 10:13
    Ian Smedley
    2

    We use JW Player on our site, this is for the 5.2, but we are looking to upgrade to 5.3 because it works seamlessly with HTML5 for Apple devices that don't support flash.

    We set the video file into a variable:

    <xsl:variable name="Video">
        <xsl:if test="$currentPage/data [@alias = 'Media'] != ''">
    
        <xsl:for-each select="umbraco.library:GetMedia($mediaID, 'true')/node">
                <xsl:if test="@nodeTypeAlias='Video'">
                    <xsl:value-of select="data [@alias='videofile']"/>
                </xsl:if>
            </xsl:for-each>
        </xsl:if>
    </xsl:variable>

    Then just output the javascript to insert the player, if you are using JW Player 5.3 the  code is different (easier) as you don't have to use SWFObject to insert the flash.

    <xsl:when test="$VideoImage != '' ">
                          <div id='player'>Your browser/device does not currently support flash.</div>
    
                          <script type='text/javascript'>
                            var so = new SWFObject('/flash/player.swf','mpl','337','236','9');
                            so.addParam('allowfullscreen','true');
                            so.addParam('allowscriptaccess','always');
                            so.addParam('wmode','opaque');
                            so.addVariable('file','<xsl:value-of select="$Video" />');
                            so.addVariable('image','<xsl:value-of select="$VideoImage" />');
                            so.addVariable('plugins', 'gapro-1');
                            so.addVariable('gapro.accountid', 'UA-111111-1');
                            so.write('player');
                          </script>
    </xsl:when>

     

    You can just use the normal code that the JWPlayer will generate for you using their handy wizard tool!

  • Lister 32 posts 52 karma points
    Nov 05, 2010 @ 14:03
    Lister
    0

    thanks for that. So is your solution the same as the package Rik suggests?


    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft