找回密码
 立即注册

QQ登录

只需一步,快速开始

kyb11111

中级会员

28

主题

72

帖子

534

积分

中级会员

积分
534

活字格认证

kyb11111
中级会员   /  发表于:2016-3-23 19:51  /   查看:7314  /  回复:10
WPF 接收的内存流 怎么播放出来

10 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2016-3-24 09:42:31
沙发
从您的问题描述来看,您有一个流文件,并且想要播放出来。
可以通过C1MediaItem.MediaStream指定文件流,并通过C1MediaPlayer的Play方法播放。

我们的产品博客有中文的文章介绍如何使用 C1MediaPlayer 播放视频文件,参考链接:
http://blog.gcpowertools.com.cn/ ... _C1MediaPlayer.aspx
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
kyb11111
中级会员   /  发表于:2016-3-24 10:37:09
板凳
WPF 中在C1MediaItem中并没有找到MediaStream属性
namespace C1.WPF.MediaPlayer
{
    //
    // 摘要:
    //     A media file that can be played by C1.WPF.MediaPlayer.C1MediaPlayer.
    [ContentProperty("Chapters")]
    public class C1MediaItem : INotifyPropertyChanged
    {
        //
        // 摘要:
        //     Initializes a new instance of the C1.WPF.MediaPlayer.C1MediaItem class.
        public C1MediaItem();

        //
        // 摘要:
        //     Gets the list of C1.WPF.MediaPlayer.C1MediaChapter for this media item.
        public ObservableCollection<C1MediaChapter> Chapters { get; }
        //
        // 摘要:
        //     Gets or sets the address of the media file.
        public Uri MediaSource { get; set; }
        //
        // 摘要:
        //     Gets or sets the duration to show for this item in the item list.
        public TimeSpan NaturalDuration { get; set; }
        //
        // 摘要:
        //     Gets or sets the image that represents the item in the item list.
        public ImageSource ThumbnailSource { get; set; }
        //
        // 摘要:
        //     Gets or sets the name of the media item.
        public string Title { get; set; }
        [CLSCompliant(false)]
        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public object _InternalCommandTarget { get; }

        //
        // 摘要:
        //     Occurs when the items list of the collection has changed, or the collection is
        //     reset.
        public event PropertyChangedEventHandler PropertyChanged;

        //
        // 摘要:
        //     Raises the C1.WPF.MediaPlayer.C1MediaItem.PropertyChanged event with the provided
        //     arguments.
        protected void OnPropertyChanged(string prop);
    }
}
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-3-24 11:56:06
地板
kyb11111 发表于 2016-3-24 10:37
WPF 中在C1MediaItem中并没有找到MediaStream属性
namespace C1.WPF.MediaPlayer
{

谢谢您的反馈。
经过确认,由于WPF平台与Silverlight的平台不同,基于安全性的考虑,WPF不提供MediaStream文件流的方式。
它提供了MediaSource 可以指定一个Uri或是打开本地的路径。
  1. C1MediaItem MediaClip = new C1MediaItem();
  2. MediaClip.MediaSource = new Uri(MediaPath);
  3. MediaClip.Title = title;   
  4. MediaPlayerControl.Items.Add(MediaClip);
复制代码
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
kyb11111
中级会员   /  发表于:2016-3-24 12:31:47
5#
Alice 发表于 2016-3-24 11:56
谢谢您的反馈。
经过确认,由于WPF平台与Silverlight的平台不同,基于安全性的考虑,WPF不提供MediaStre ...

WPF 视频Uri 可以是网络地址吗?
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-3-24 14:35:53
6#
kyb11111 发表于 2016-3-24 12:31
WPF 视频Uri 可以是网络地址吗?

可以,比如设置 MediaSource为"http://download.componentone.com/pub/Videos/Trevor%20Does%20Silverlight.wmv".

如何使用属性,可以参考产品文档:
http://helpcentral.componentone. ... Player_Control.html
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
kyb11111
中级会员   /  发表于:2016-3-24 17:46:19
7#
Alice 发表于 2016-3-24 14:35
可以,比如设置 MediaSource为"http://download.componentone.com/pub/Videos/Trevor%20Does%20Silverlig ...

好的谢谢
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-3-25 09:25:14
8#

不用客气
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
kyb11111
中级会员   /  发表于:2016-4-6 14:46:48
9#
wpf 控件可以播放 flv格式的视频吗
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-4-6 17:41:58
10#
kyb11111 发表于 2016-4-6 14:46
wpf 控件可以播放 flv格式的视频吗

不支持。

C1MediaPlayer 支持的文件格式:
支持如下视频格式:
&#8226;Raw Video
&#8226;YV12 - YCrCb(4:2:0)
&#8226;RGBA - 32 bit Alpha Red, Green, Blue
&#8226;WMV, MV2, and MV3 ( Windows Media Video 7, 8, and 9)
&#8226;Supports Simple and Main Profiles
&#8226;Supports only progressive (non-interlaced) content.
&#8226;WMVA: Windows Media Video Advanced Profile, non-VC-1.
&#8226;WVC1: Windows Media Video Advanced Profile, VC-1.
&#8226;Supports Advanced Profile.
&#8226;Supports only progressive (non-interlaced) content.
&#8226;H264 (ITU-T H.264 / ISO MPEG-4 AVC).

支持如下音频格式:
&#8226;“1” - WAV format.
&#8226;"353" - Microsoft Windows Media Audio v7, v8 and v9.x Standard (WMA Standard).
&#8226;"354" - Microsoft Windows Media Audio v9.x and v10 Professional (WMA Professional).
&#8226;"85" - ISO MPEG-1 Layer III (MP3).
&#8226;"255" - ISO Advanced Audio Coding (AAC).
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部