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

(Hybrid Smart Client) RSS Media Player

, 9 Mar 2009 CPOL
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)

Share

About the Author

Paul_Wade
Software Developer (Senior) Anytime Fitness
United States United States
No Biography provided
Follow on   Twitter

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.1411022.1 | Last Updated 9 Mar 2009
Article Copyright 2009 by Paul_Wade
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid