Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Silverlight Media Player

, 6 Apr 2009 Public Domain
Has some cool features like sliding menus with animation and Drag N Drop from menu
SilverLightMediaPlayer.zip
SilverLightMediaPlayer
MediaPlayer
Bin
Debug
de
System.Xml.Linq.resources.dll
es
System.Xml.Linq.resources.dll
fr
System.Xml.Linq.resources.dll
it
System.Xml.Linq.resources.dll
ja
System.Xml.Linq.resources.dll
ko
System.Xml.Linq.resources.dll
MediaPlayer.dll
MediaPlayer.xap
System.Xml.Linq.dll
zh-Hans
System.Xml.Linq.resources.dll
zh-Hant
System.Xml.Linq.resources.dll
MediaPlayer.csproj.user
Properties
v1.jpg
v2.jpg
MediaPlayerLive
App_Data
bin
de
System.Web.Silverlight.resources.dll
es
System.Web.Silverlight.resources.dll
fr
System.Web.Silverlight.resources.dll
it
System.Web.Silverlight.resources.dll
ja
System.Web.Silverlight.resources.dll
ko
System.Web.Silverlight.resources.dll
MediaPlayerLive.dll
MediaPlayerLive.pdb
System.Web.Silverlight.dll
zh-Hans
System.Web.Silverlight.resources.dll
zh-Hant
System.Web.Silverlight.resources.dll
ClientBin
MediaPlayer.xap
MediaPlayerLive.csproj.user
Properties
SilverLightMediaPlayer.suo
<UserControl x:Class="MediaPlayer.Page" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            xmlns:HGallery="clr-namespace:MediaPlayer"
    Width="550" Height="430">    
    <Grid x:Name="LayoutRoot" Background="White" MouseLeftButtonUp="StackPanel_MouseLeftButtonUp"
          >
        <Grid.RowDefinitions>
            <RowDefinition  Height="*"></RowDefinition>
            <RowDefinition Height="40"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.RenderTransform>
            <ScaleTransform ScaleX="1" ScaleY="1" x:Name="playerTransform"/>
        </Grid.RenderTransform>
        <Grid Grid.Row="0" Grid.Column="0" x:Name="gridUpper" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition  Width="85"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Canvas Grid.Row="0" Grid.Column="0"  x:Name="spPlayer" >
                <Popup IsOpen="True" x:Name="popup1" >
                    <Image Width="100" Opacity=".4"  
                   Height="100" />
                </Popup>
                <Border BorderBrush="Black" BorderThickness="2" Background="Black"  >
                    <MediaElement HorizontalAlignment="Center" Height="380" Width="458" VerticalAlignment="Stretch"
                                      MouseLeftButtonDown="myPlayer_MouseLeftButtonDown"                                           
                                      x:Name="myPlayer" CurrentStateChanged="myPlayer_CurrentStateChanged" 
                                      Source="http://localhost/SilverLightMediaPlayer/MediaPlayerLive/ClientBin/demo.wmv" >

                    </MediaElement>
                </Border >
                <StackPanel Orientation="Horizontal" x:Name="stackMenu"  MouseLeftButtonDown="stackMenu_MouseLeftButtonDown" Opacity="0" Height="50" >
                    <HGallery:HorizontalGallery x:Name="ucHGallery" GalleryMode="Big"></HGallery:HorizontalGallery>
                    
                </StackPanel>
                <Canvas.Resources>
                    <Storyboard x:Name="menuBoardShow">
                        <DoubleAnimation
                              Storyboard.TargetName="stackMenu"
                              Storyboard.TargetProperty="Opacity" By=".1"
                              From="0.0" To="1.0" Duration="0:0:1"                               
                              />
                    </Storyboard>
                    <Storyboard x:Name="menuBoardHide">
                        <DoubleAnimation
                              Storyboard.TargetName="stackMenu"
                              Storyboard.TargetProperty="Opacity" By=".1"
                              From="1.0" To="0.0" Duration="0:0:1"                               
                              />
                    </Storyboard>
                </Canvas.Resources>
            </Canvas>
            <StackPanel  Grid.Row="0" Grid.Column="1" MouseEnter="ScrollViewer_MouseEnter"  x:Name="spCollapsableMenu"
                         Orientation="Horizontal" Margin="0,50,0,0" HorizontalAlignment="Left" >                
                
                <ScrollViewer Height="300" Width="0" Visibility="Collapsed" Margin="0,20,0,0"
                         VerticalScrollBarVisibility="Visible"  x:Name="sbar" 
                          VerticalAlignment="Top" 
                          >
                    <ScrollViewer.Resources>
                        <Storyboard x:Name="sbarShow" >
                            <DoubleAnimation By="1" From="0" To="75" Duration="0:0:1" 
                                         Storyboard.TargetName="sbar"
                                         Storyboard.TargetProperty="Width"/>
                        </Storyboard>
                        <Storyboard x:Name="sbarHide" Completed="sbarHide_Completed">
                            <DoubleAnimation By="1" From="75" To="0" Duration="0:0:1" 
                                         Storyboard.TargetName="sbar"
                                         Storyboard.TargetProperty="Width"/>
                        </Storyboard>
                    </ScrollViewer.Resources>
                    <ScrollViewer.Content >                        
                        <StackPanel Margin="2,0,0,0" Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" x:Name="vertGallery"
                        Orientation="Vertical" HorizontalAlignment="Center"
                        MouseLeftButtonDown="StackPanel_MouseLeftButtonDown"
                        MouseMove="StackPanel_MouseMove" >
                        </StackPanel>
                    </ScrollViewer.Content>
                </ScrollViewer>
                <Border Width="7" Height="300" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"
                        VerticalAlignment="Center">
                    <Border.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Color="Blue" Offset=".2"/>
                            <GradientStop Color="LightBlue" Offset=".8"/>
                            <GradientStop Color="Blue" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <TextBlock x:Name="txtCPanels" Margin="0,150,0,0" FontWeight="Bold"
                               Foreground="DarkBlue" >
                        ><LineBreak  />>
                    </TextBlock>
                </Border>                
            </StackPanel>
        </Grid>
        <StackPanel Grid.Row="1" Orientation="Horizontal"  >
            <Border CornerRadius="10" BorderThickness="1" Margin="2,2,2,2"  BorderBrush="Black">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
                    <Button  x:Name="btnPP"  Margin="5,0,0,0" FontWeight="Bold" Content="ll" Width="20" Height="20" 
                     Click="Button_Click">
                    </Button>
                    <Slider MouseLeftButtonDown="sliderPosition_MouseLeftButtonDown" Margin="5,0,0,0"
                        x:Name="sliderPosition"  
                        Width="200" Minimum="0" Maximum="1" 
                        MouseLeftButtonUp="sliderPosition_MouseLeftButtonUp" >
                    </Slider>
                    <TextBlock x:Name="txtDuration" Text="0:00" ></TextBlock>
                    <Button Margin="20,0,0,0" Width="21"  ToolTipService.ToolTip="FullScreen" Height="20" x:Name="btnFullScreen" Click="btnFullScreen_Click">
                        <Button.Content >
                            <Canvas Width="25" Height="20">
                                <Rectangle Width="10" Height="10" Stroke="Black" Canvas.Top="0" Canvas.Left="0"></Rectangle>
                                <Rectangle Width="12" Height="12" Stroke="Black" Canvas.Top="3" Canvas.Left="3"></Rectangle>
                            </Canvas>
                        </Button.Content>
                    </Button>
                    <TextBlock x:Name="txtVol" Text="Vol:" Margin="20,0,0,0"></TextBlock>
                    <Slider x:Name="sliderVolume"  ValueChanged="sliderVolume_ValueChanged" Width="75" Minimum="0" Maximum="1"  ></Slider>
                    <Button x:Name="btnMute" Content="On" Click="btnMute_Click" Height="20" Margin="0,0,5,0">
                    </Button>
                </StackPanel>
            </Border>            
        </StackPanel>

    </Grid>  
    
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication

Share

About the Author

sunit_82
Software Developer (Senior) Geometric
India India
B.E. in Information Technology
MCTS(.NET 2.0 )

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 6 Apr 2009
Article Copyright 2009 by sunit_82
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid