Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

How To: Skinning the Silverlight Media Player
Roger Martin
#1 Posted : Monday, 9 February 2009 3:23:03 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,301
Location: Fort Atkinson, WI

Gallery Server uses Silverlight to play wmv, wma, mp3, asf, and asx files. There are several skins available that modify the appearance and function of the player control. By default, the Professional skin is used for video and AudioGray is for audio:

[img]http://lh6.ggpht.com/_qh4427KVFsk/SZBvAbusMtI/AAAAAAAAAFY/-z9aUueEi5k/Skin_professional%5B4%5D.jpg?imgmax=800[/img]

[img]http://lh3.ggpht.com/_qh4427KVFsk/SZB7j7SDQ-I/AAAAAAAAAFw/nq6ksU_hKFg/Skin_audiogray%5B5%5D.jpg?imgmax=800[/img]

Later in this post you can see sample images of the rest of the skins.

Gallery Server includes eight different skins. A skin is a .xaml file and is stored in the gs\skins\mediaplayer directory. To use a different skin, update gs\config\galleryserverpro.config to refer to the desired .xaml file for the relevant media type. For example, the rendering for Windows Media files (.wmv) is defined like this in galleryserverpro.config:

Code:
<mediaObject mimeType="video/x-ms-wmv">
<browsers>
<browser id="default" htmlOutput="&lt;div id='mp1p'&gt;&lt;/div&gt;"
scriptOutput="Sys.UI.Silverlight.Control.createObject('mp1p', '&lt;object type=&quot;application/x-silverlight&quot; id=&quot;mp1&quot; style=&quot;height:{Height}px;width:{Width}px;&quot;&gt;&lt;param name=&quot;Windowless&quot; value=&quot;True&quot; /&gt;&lt;a href=&quot;http://go2.microsoft.com/fwlink/?LinkID=114576&amp;v=1.0&quot;&gt;&lt;img src=&quot;http://go2.microsoft.com/fwlink/?LinkID=108181&quot; alt=&quot;Get Microsoft Silverlight&quot; style=&quot;border-width:0;&quot; /&gt;&lt;/a&gt;&lt;/object&gt;'); Sys.Application.add_init(function() { $create(Sys.UI.Silverlight.MediaPlayer, { &quot;mediaSource&quot;: &quot;{MediaObjectUrl}&quot;, &quot;scaleMode&quot;: 1, &quot;source&quot;: &quot;{GalleryPath}/skins/mediaplayer/Professional.xaml&quot;,&quot;autoPlay&quot;:{AutoStartMediaObjectText} }, null, null, $get(&quot;mp1p&quot;)); }); Sys.Application.initialize();Array.add(_mediaObjectsToDispose, &quot;mp1&quot;);" />
</browsers>
</mediaObject>


Notice the template specifies Professional.xaml. Change this to any valid .xaml file. For example, to use the Futuristic skin for .wmv videos, change Professional.xaml to Futuristic.xaml. Save galleryserverpro.config and your changes immediately take effect in the gallery.

Look in the gs\skins\mediaplayer directory for the complete list of available skins. An example of each skin is shown below.

Modify a skin by editing the .xaml file in any text editor. For the best design experience, use a program designed for .xaml such as Microsoft Expression Blend.

Skin samples

Basic (Basic.xaml)
Lightweight .xaml file. Does not include any visible controls. Start/pause a video by clicking it with the mouse.
[img]http://lh4.ggpht.com/_qh4427KVFsk/SZBvBK3_kyI/AAAAAAAAAFc/FIOC9PJd1eM/Skin_basic%5B6%5D.jpg?imgmax=800[/img]

Simple (Simple.xaml)
Does not include borders like the Basic skin, but a control panel appears when the mouse hovers over the video.
[img]http://lh5.ggpht.com/_qh4427KVFsk/SZBvB4JJwOI/AAAAAAAAAFg/lGK3Qr7wYbU/Skin_simple%5B4%5D.jpg?imgmax=800[/img]

Classic (Classic.xaml)
[img]http://lh3.ggpht.com/_qh4427KVFsk/SZBvCyznJBI/AAAAAAAAAFk/fkIrX4qwZ7M/Skin_classic%5B4%5D.jpg?imgmax=800[/img]

Console (Console.xaml)
[img]http://lh5.ggpht.com/_qh4427KVFsk/SZBvEqg62ZI/AAAAAAAAAFo/XSzLhwsLBDg/Skin_console%5B4%5D.jpg?imgmax=800[/img]

Expression (Expression.xaml)
This skin uses a semi-transparent control panel that appears when you hover over the video, as seen below. Normally, the controls are hidden.
[img]http://lh3.ggpht.com/_qh4427KVFsk/SZBvFm9Mq9I/AAAAAAAAAFs/wgscqI6YBO8/Skin_expression%5B4%5D.jpg?imgmax=800[/img]

Futuristic (Futuristic.xaml)
[img]http://lh3.ggpht.com/_qh4427KVFsk/SZBvHIrOVpI/AAAAAAAAAFQ/rQBtXC_iJyQ/Skin_futuristic_thumb%5B1%5D.jpg?imgmax=800[/img]

Professional (Professional.xaml)
[img]http://lh6.ggpht.com/_qh4427KVFsk/SZBvAbusMtI/AAAAAAAAAFY/-z9aUueEi5k/Skin_professional%5B4%5D.jpg?imgmax=800[/img]

AudioGray (AudioGray.xaml)
[img]http://lh3.ggpht.com/_qh4427KVFsk/SZB7j7SDQ-I/AAAAAAAAAFw/nq6ksU_hKFg/Skin_audiogray%5B5%5D.jpg?imgmax=800[/img]
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.