zoukankan      html  css  js  c++  java
  • WPF Media 简单的播放器

    <Window x:Class="PlayTest.MediaControl"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MediaControl" Height="300" Width="300">
        <Grid>
            <Grid.Triggers>
                <EventTrigger RoutedEvent="Button.Click" SourceName="playButton">
                    <EventTrigger.Actions>
                        <BeginStoryboard Name="beginStoryboard">
                            <Storyboard>
                                <MediaTimeline Source="e:\第1讲.Linux应用与发展(下).wmv"
                                               Storyboard.TargetName="video"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
                <EventTrigger RoutedEvent="Button.Click" SourceName="pauseButton">
                    <EventTrigger.Actions>
                        <PauseStoryboard BeginStoryboardName="beginStoryboard"/>
                    </EventTrigger.Actions>
                </EventTrigger>
                <EventTrigger RoutedEvent="Button.Click" SourceName="resumeButton">
                    <EventTrigger.Actions>
                        <ResumeStoryboard BeginStoryboardName="beginStoryboard"/>
                    </EventTrigger.Actions>
                </EventTrigger>
            </Grid.Triggers>
            
            <MediaElement x:Name="video"/>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                <Button x:Name="playButton" Background="Brown" Height="40">Play</Button>
                <Button x:Name="pauseButton" Background="Brown" Height="40">Pause</Button>
                <Button x:Name="resumeButton" Background="Brown" Height="40">Resume</Button>
            </StackPanel>
        </Grid>
    </Window>

    WPF揭秘 14.2

  • 相关阅读:
    php学习之Model类
    PHP学习之图像处理-水印类
    PHP学习之文件上传类
    windows 安装gitea
    下载安装office2019
    第6章 互联网的那些事儿
    第五章 了解你的用户
    第四章 关于测试的一些思考
    第三章 web设计原则:
    第二章 编程之道
  • 原文地址:https://www.cnblogs.com/Events/p/3449222.html
Copyright © 2011-2022 走看看