Copied to clipboard

Flag this post as spam?

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


  • Fredrik Esseen 610 posts 906 karma points
    Aug 12, 2009 @ 15:57
    Fredrik Esseen
    0

    Multiple videos

    Is there any module that allows multiple videoplayers on one page? With the one I used there is a problem with same ID:s which makes only one vide work.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 12, 2009 @ 16:11
    Dirk De Grave
    0

    Have seen some threads lately about that... Let me see if I can find those...

    Here it goes... 

     

    Hope that helps.

     

    Regards,

    /Dirk

  • Fredrik Esseen 610 posts 906 karma points
    Aug 12, 2009 @ 16:40
    Fredrik Esseen
    0

    That thread is about the DesignIT Video Embed which uses urls to embed videos.

    Is it possible to use that datatype with flv or any other vide format?

    Otherwise I use the EndForwardFlvPlayer but then I get that problem with multiple videos..

  • dandrayne 1138 posts 2262 karma points
    Aug 12, 2009 @ 17:18
    dandrayne
    0

    I'd recommend using flowplayer with the playlist plugin.  Then it's as simple as adding videos to the media library and using a multiple media picker to select more than one, then some xslt to write out a list of links to the movie files.  Flowplayer does the rest

  • bob baty-barr 1180 posts 1294 karma points MVP
    Aug 12, 2009 @ 18:02
    bob baty-barr
    100

    i have been working on an umbraco driven flowplayer implementation and it is quite nice... packaging it up with the proper script inserts has proven to be a bit of a challenge... check out the dev implementation of it here... http://wreckstoriches.com.strenghosting.com/

    flowplayer is awesome!

    i also have a macro on http://packages.maliciousthinktank.com that plays swf files and uses the media id to append to the player id to avoid conflicts - direct link to the swf player demo is here...

    http://packages.maliciousthinktank.com/flash-video/externalvideo.aspx

    for flv... definitely recommend flowplayer.

  • Fredrik Esseen 610 posts 906 karma points
    Aug 13, 2009 @ 08:26
    Fredrik Esseen
    0

    That implementation of flowplayer looks awesome! Would be nice to see the code behind ;)

    Ive used your videoplayer before, Bob and now that you have extended the package with multiple videos its even better :)

    Thanks for your help!

  • Fredrik Esseen 610 posts 906 karma points
    Sep 03, 2009 @ 14:24
    Fredrik Esseen
    0

    Hi again!

     

    Bob: Is it possible in some way to use your simpe video player to play multiple videos the same way the external does?

  • Fredrik Esseen 610 posts 906 karma points
    Sep 03, 2009 @ 14:37
    Fredrik Esseen
    0

    I also tried out your externalvideo that you said is ablee to play multiple videos without conflict but when I add two videos the both disappear?

  • Fredrik Esseen 610 posts 906 karma points
    Sep 03, 2009 @ 17:05
    Fredrik Esseen
    0

    I tried to try a solution:

    Since the problem seems to be that there is multiple identical id I try to make dynamic id:s in the xslt file

    <xsl:if test="$vidToPlay != '' ">
    <xsl:variable name="showMe" select="umbraco.library:GetMedia($vidToPlay/node/@id, 0)/data [@alias = 'umbracoFile']" />
     <h3><xsl:value-of select="$vidHeader"/></h3>
    <div id="<xsl:value-of select="$showMe"/>">
     <script type="text/javascript">
       var mttVid1 = new SWFObject("/media/283/player_flv_maxi.swf", "flashVid", "<xsl:value-of select="$vidW"/>", "<xsl:value-of select="$vidH"/>", "9", "#FFFFFF");
       mttVid1.addParam("FlashVars", "flv=<xsl:value-of select="$showMe"/>&amp;showfullscreen=1");
       mttVid1.addParam("allowfullscreen","true");
       mttVid1.write("<xsl:value-of select="$showMe"/>");  
     </script>
    </div>
    </xsl:if>

    But I get an error div id. How can I make this work?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 03, 2009 @ 17:36
    Dirk De Grave
    0

    Hi,

    <div><xsl:attribute name="id">vid-<xsl:value-of select="$showMe"/></xsl:attribute></div>

    should resolve the duplicate div id error.

    But, I'm little surprised why you're using the file name of the media item as the div id value? I'd rather go with the id of the media item, will be unique for each media item.

     

    Cheers,

    /Dirk

     

     

  • bob baty-barr 1180 posts 1294 karma points MVP
    Sep 03, 2009 @ 17:38
    bob baty-barr
    1

    okay, you are very close...

    for your divID -- i typically use a static name appended with the node id of the media file... with the { } syntax

    <div id ="myVideo{$vidToPlay}">

    you also need to use that variable in your var mttVid1 refrences as well...

    var= mttVid<xsl:value-of select="$vidToPlay"/>

    and refrence that throughout the rest of that javascript chunk... this keeps all your refrences unique for multiple players on the page

    and finish the script out with
    mttVid<xsl:value-of select="$vidToPlay"/>.write ("myVideo<xsl:value-of select="$vidToPlay"/>");

     

    that should set you up for using multiple instances on the same page.

  • Fredrik Esseen 610 posts 906 karma points
    Sep 03, 2009 @ 17:58
    Fredrik Esseen
    0

    Got error: Identifier expected:

    Syntax error?

    <div id ="myVideo{$vidToPlay}">
     <script type="text/javascript">
       var = mttVid<xsl:value-of select="$vidToPlay"/> = new SWFObject("/media/283/player_flv_maxi.swf", "flashVid", "<xsl:value-of select="$vidW"/>", "<xsl:value-of select="$vidH"/>", "9", "#FFFFFF");
       mttVid<xsl:value-of select="$vidToPlay"/>.addParam("FlashVars", "flv=<xsl:value-of select="$showMe"/>&amp;showfullscreen=1");
       mttVid<xsl:value-of select="$vidToPlay"/>.addParam("allowfullscreen","true");
       mttVid<xsl:value-of select="$vidToPlay"/>.write("myVideo<xsl:value-of select="$vidToPlay"/>");  
     </script>
    </div>
  • Fredrik Esseen 610 posts 906 karma points
    Sep 03, 2009 @ 18:44
    Fredrik Esseen
    0

    Solved it "temporarily":

    <div id ="myVideo{$vidToPlay/node/@id}">
     <script type="text/javascript">
       var mttVid<xsl:value-of select="$vidToPlay/node/@id"/> = new SWFObject("/media/283/player_flv_maxi.swf", "flashVid", "<xsl:value-of select="$vidW"/>", "<xsl:value-of select="$vidH"/>", "9", "#FFFFFF");
       mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam("FlashVars", "flv=<xsl:value-of select="$showMe"/>&amp;showfullscreen=1");
       mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam("allowfullscreen","true");
       mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.write("myVideo<xsl:value-of select="$vidToPlay/node/@id"/>");  
     </script>
    </div>

    The only problem now is that in explorer, if I ´reload the page or move away and go back the player is just a black dot...?

  • Fredrik Esseen 610 posts 906 karma points
    Sep 03, 2009 @ 20:04
    Fredrik Esseen
    0

    i Finally got all working by using the jwlplayer-based package endforwardFlvPlayer. I switch to that swf-file and then it worked!

    Final code:

    <?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 = "vidToPlay" select="/macro/videoNodeId"/>

    <xsl:template match="/">
      <xsl:value-of select="videoNode"/>
      <xsl:variable name="showMe" select="umbraco.library:GetMedia($vidToPlay/node/@id, 0)/data [@alias = 'umbracoFile']" />
    <div id ="myVideo{$vidToPlay/node/@id}">
        <a href="http://www.macromedia.com/go/getflashplayer">För att se filmen behöver du en flashspelare. Hämta den här.</a>  </div>
     
      <script type="text/javascript">
        var mttVid<xsl:value-of select="$vidToPlay/node/@id"/> = new SWFObject("/endforward umbraco flv/jwplayer/player.swf","ply","460","290","9","#FFFFFF");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam("allowfullscreen","true");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam("allowscriptaccess","always");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam("flashvars","file=<xsl:value-of select="$showMe"/>");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.write("myVideo<xsl:value-of select="$vidToPlay/node/@id"/>");
      </script>
    </xsl:template>
    </xsl:stylesheet>
Please Sign in or register to post replies

Write your reply to:

Draft