Click here to Skip to main content
15,884,353 members
Articles / Desktop Programming / WPF

(Hybrid Smart Client) RSS Media Player

Rate me:
Please Sign up or sign in to vote.
3.92/5 (8 votes)
9 Mar 2009CPOL4 min read 68.5K   1K   17  
A WPF application for viewing RSS video feeds. Built using the MVVM pattern.
<UserControl x:Class="RSSVideoPlayer.MediaElementControl.MyMediaControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:RSSVideoPlayer" 
    xmlns:DC="clr-namespace:RSSVideoPlayer.DataConverters"       
    MinWidth="250" MinHeight="200">
    <UserControl.Resources>
        <ResourceDictionary Source="MediaControlLibrary.xaml"/>
    </UserControl.Resources>
    <Grid>
        <DockPanel>
            <!--Media Element controls-->
            <DockPanel DockPanel.Dock="Bottom" >
                <DockPanel DockPanel.Dock="Top" LastChildFill="False"   Height="40" Background="Black">
                <StackPanel  Orientation="Horizontal">
                    <Button Foreground="White" Name="btnPlay" Width="60" Margin="5" Click="btnPlay_Click">Play</Button>
                    <Button Foreground="White" Name="btnPause" Width="60" Margin="5" Click="btnPause_Click">Pause</Button>
                    <Button Foreground="White" Name="btnStop" Width="60" Margin="5" Click="btnStop_Click">Stop</Button>
                    </StackPanel>
                    <StackPanel  DockPanel.Dock="Right"  Orientation="Vertical">
                        <Slider Orientation="Horizontal" Width="100" HorizontalAlignment="Right" Value="{Binding ElementName=mMediaElement, Path=Volume}" Maximum="1"></Slider>
                        <TextBlock Foreground="White">Volume:<TextBlock  Foreground="White"  Text="{Binding ElementName=mMediaElement, Path=Volume, Converter={StaticResource DoubleToPercent}}"></TextBlock>%</TextBlock>
                    </StackPanel>
                </DockPanel>
                
                <!--Time Line Slider-->
                <DockPanel Background="Black">
                    <StackPanel DockPanel.Dock="Bottom"  Orientation="Horizontal" Background="Black">
                        <TextBlock Width="100" Foreground="White">Position: <TextBlock Name="txtPosition" DockPanel.Dock="Bottom" /></TextBlock>
                        <TextBlock Width="100" Foreground="White">Buffer: <TextBlock  Name="txtBuffer" DockPanel.Dock="Bottom" /></TextBlock>
                    </StackPanel>
                    <Slider Name="sldTimeLine" Margin="5"   Minimum="1" PreviewMouseLeftButtonDown="sldTimeLine_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="sldTimeLine_PreviewMouseLeftButtonUp"></Slider>
                </DockPanel>
                <!--Time Line Slider-->
            </DockPanel>
            <!--END Media Element controls-->


            <!--Media element in dock is filled because Dockpanel defaults to lastchildfill-->
            <MediaElement Name="mMediaElement" MediaOpened="mMediaElement_MediaOpened" Stretch="Uniform" ScrubbingEnabled="True" Unloaded="mMediaElement_Unloaded"></MediaElement>
        </DockPanel>
    </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 The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Anytime Fitness
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions