Copied to clipboard

Flag this post as spam?

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


  • Christophe 23 posts 43 karma points
    Sep 14, 2010 @ 17:22
    Christophe
    0

    Silverlight Player Won't Play

    Hello,

    I post this because I have tried most topics on this forum and can't get any of them to work. Someone else designed and set up my site and I am trying to add to it myself.

    I am trying to embed a simple Silverlight media player on a web page (my site runs Umbraco version 4.0.2 if it matters). I currently have a Windows Media Player embedded pulling out of publishing points (on demand and live) on a remote Media server. The player works well for anyone who can play it but there are way to many people who can't play it (i.e. Mac users). I heard that Silverlight would work on many platforms, plus it looks great, but I can't seem to set it up right. None of the packages will intall. I have tried using the videoplayer.xap and .js methods but to no avail.

    I usually don't like to bother until I am frustrated so here i am.

    Thanks in advance for your help and patience,

    Christophe

  • Ferry Meidianto 36 posts 63 karma points
    Sep 14, 2010 @ 18:53
    Ferry Meidianto
    0

    Hi Christophe,

    Have you registered .xap MIME type?
    This is how to do it:
    http://learn.iis.net/page.aspx/262/configuring-iis-for-silverlight-applications/

    Cheers,
    Ferry

  • Christophe 23 posts 43 karma points
    Sep 14, 2010 @ 21:16
    Christophe
    0

    Hello Ferry,

    The only access I have to the website is through ftp so I don't really know. I'll check with the hoster (slow to respond thus me ending up doing many things on my own).

    I should mention that in one of my attempts I was able to see a white box that says "Silverlight" when I right-click. Means anything?

    Thank you,

    Christophe

  • Ferry Meidianto 36 posts 63 karma points
    Sep 14, 2010 @ 21:51
    Ferry Meidianto
    0

    That means the web server has been configured correctly (MIME types were added) and you have installed Silverlight runtime.
    I guess it's the code/package that you installed.

  • Christophe 23 posts 43 karma points
    Sep 16, 2010 @ 07:38
    Christophe
    0

    Alright I'm back with no answer on the .xap .

    Alternatively, I found this jwplayer that uses javascript files and a .xaml file.

    I have put the 2 .js files and the .xaml file in my site's folder (via ftp) and now I have the following javascript to setup:

    <div id="myplayer">the player will be placed here</div>
    
    <script type="text/javascript">
        var elm = document.getElementById("myplayer");
        var src = '/wmvplayer.xaml';
        var cfg = {
            file:'mms://ip_address/publishing_point',
            width:'320',
            height:'240'
        };
        var ply = new jeroenwijering.Player(elm,src,cfg);
    </script>

    The problem is that if I put this in html in my text document I get nothing (except the "the player will be placed here"). I tried using an xslt and it worked (!!) but I would have to create a separate macro for each video I want to insert? That doesn't make sense i think.

    How do I insert the script (with different cfg) everywhere I want to insert a video?

    Thanks you,

    Christophe

  • Ferry Meidianto 36 posts 63 karma points
    Sep 16, 2010 @ 20:37
    Ferry Meidianto
    0

    Hi Christophe,

    Put the script in the XSLT (for guys prefer C# coding - like me - it would be in .ASCX) then make the file as variable.
    Then add a property in the Document Type for the user to fill the file link value.
    And then use the property value to fill the variable in XSLT.

    Cheers,
    Ferry

  • Christophe 23 posts 43 karma points
    Sep 16, 2010 @ 21:04
    Christophe
    0

    Pardon my ignorance but how do you do that? Here is the xslt code I have that worked when I inserted the macro:

    <?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="xml" omit-xml-declaration="yes"/>
    
    <xsl:param name="currentPage"/>
    
    <xsl:template match="/">
    <div id="myplayer">the player will be placed here</div>
    <script type="text/javascript">
        var elm = document.getElementById("myplayer");
        var src = '.../wmvplayer.xaml';
        var cfg = {
            file:'mms://ip_address/pub_point',
            width:'480',
            height:'360'
        };
        var ply = new jeroenwijering.Player(elm,src,cfg);
    </script>
    </xsl:template>
    
    </xsl:stylesheet>

    I would like to make the file, width, and height variables and have the choice to enter the values when I insert the macro (?).

    Thanks again.

  • Christophe 23 posts 43 karma points
    Sep 17, 2010 @ 21:55
    Christophe
    0

    Alright I played a little and tried to make variables. Here is what I've done:

    I made location (which would be mms://...), width and height variables in the modified xslt below and added the parameter in the macro.

    When I insert the macro in my content, a widow pops out and asked for the 3 parameters but it doesn't seem to work. Anyidea why? Should I post this issue as a separate issue?

    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="xml" omit-xml-declaration="yes"/>
    
    <xsl:param name="currentPage"/>
    
    <xsl:variable name="location" select="/macro/location"/>
    <xsl:variable name="width" select="/macro/width"/>
    <xsl:variable name="height" select="/macro/height"/>
    
    <xsl:template match="/">
    <div id="myplayer">the player will be placed here</div>
    <script type="text/javascript">
        var elm = document.getElementById("myplayer");
        var src = '/media/28447/wmvplayer.xaml';
        var file = '$location';
        var width = '$width';
        var height = '$height';
        var ply = new jeroenwijering.Player(elm,src,file,width,height);
    </script>
    
    </xsl:template>
    
    </xsl:stylesheet>

    Thanks,

    Christophe

  • Ferry Meidianto 36 posts 63 karma points
    Sep 18, 2010 @ 05:13
    Ferry Meidianto
    0

    Hi Christophe,

    You can use this page as reference:
    http://umbraco.org/documentation/books/xslt-basics/using-variables-and-parameters

    So, your code must be changed to be something like this:
    <xsl:variable name="location" select="$currentPage/data[@alias='location']"/>

    and then like this when using the variable:
    <xsl:value-of select="$location"/>

  • Christophe 23 posts 43 karma points
    Sep 18, 2010 @ 18:51
    Christophe
    0

    Ferry Thank You!

    I finally got it to work. The final code is below. I used urllocation as my variable and the property is in my document type. i then insert the macro into my richtext editor. 

    <?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="xml" omit-xml-declaration="yes"/>
    
    <xsl:param name="currentPage"/>
    
    <xsl:variable name="urllocation" select="$currentPage/data[@alias='urllocation']"/>
    
    <xsl:template match="/">
    <div id="myplayer">the player will be placed here</div>
    <script type="text/javascript">
        var elm = document.getElementById("myplayer");
        var src = '/media/28447/wmvplayer.xaml';
        var cfg = {
            file:'<xsl:value-of select="$urllocation"/>',
            width:'320',
            height:'240'
        };
        var ply = new jeroenwijering.Player(elm,src,cfg);
    </script>
    
    </xsl:template>
    
    </xsl:stylesheet>

    Thank again,

    Christophe

  • Ferry Meidianto 36 posts 63 karma points
    Sep 18, 2010 @ 19:10
    Ferry Meidianto
    0

    Glad to hear that.
    You're welcome.

Please Sign in or register to post replies

Write your reply to:

Draft