zoukankan      html  css  js  c++  java
  • Win8 Style App 播放Smooth Streaming

    不知道Smooth Streaming是啥参见以前随笔:http://www.cnblogs.com/sun8134/archive/2012/05/14/2499296.html

    这里主要说下怎么在win8 Style App里播放Smooth Streaming

    首先需要两个东东:

    Player Framework for Windows 8: http://playerframework.codeplex.com/releases

    Smooth Streaming Client SDK : http://visualstudiogallery.msdn.microsoft.com/04423d13-3b3e-4741-a01c-1ae29e84fea6?SRC=Home

    然后我们新建个工程:

    image

    添加引用:

    image

    在页面xaml头部添加:

        xmlns:adaptive="using:Microsoft.PlayerFramework.Adaptive"
        xmlns:mmppf="using:Microsoft.PlayerFramework"

    然后在xaml里添加:

            <mmppf:MediaPlayer Source="http://mediadl.microsoft.com/mediadl/iisnet/smoothmedia/Experience/BigBuckBunny_720p.ism/Manifest">
                <mmppf:MediaPlayer.Plugins>
                    <adaptive:AdaptivePlugin />
                </mmppf:MediaPlayer.Plugins>
            </mmppf:MediaPlayer>

    然后注意下修改调试设置,由于使用了Microsoft Visual C++ Runtime Package,设置Any CPU是会报错的额

    需要根据你自己的机器设置(我用的X64)

    image

    image

    到这里基本操作完成,运行看看效果:

    image

    image

    当然如果想在codebehind里控制播放:

            private void Page_Loaded(object sender, RoutedEventArgs e)
            {
                MediaPlayer player = new MediaPlayer();
                Grid1.Children.Add(player);
                player.Source = new Uri("http://127.0.0.1/Tom.Clancys.Ghost.Recon.Alpha.2012.ism/manifest");
                var adaptivePlugin = new Microsoft.PlayerFramework.Adaptive.AdaptivePlugin();
                player.Plugins.Add(adaptivePlugin);
                player.Play();            
            }

    更多内容可以看文档:http://playerframework.codeplex.com/documentation

  • 相关阅读:
    23.C++- 继承的多种方式、显示调用父类构造函数、父子之间的同名函数、virtual虚函数
    22.C++- 继承与组合,protected访问级别
    LeetCode-391. 完美矩形(使用C语言编译,详解)
    LeetCode-101.对称二叉树
    STM32-对芯片启动读保护,实现加密(详解)
    21.C++- "++"操作符重载、隐式转换之explicit关键字、类的类型转换函数
    20.C++- "&&","||"逻辑重载操作符的缺陷、","逗号重载操作符的分析
    19.C++-(=)赋值操作符、初步编写智能指针
    18.C++-[ ]操作符使用 、函数对象与普通函数区别(详解)
    ECMAScript 6.0基础入门教程
  • 原文地址:https://www.cnblogs.com/sun8134/p/2778927.html
Copyright © 2011-2022 走看看