本帖最后由 skynq 于 2013-09-17 23:07:12 编辑

解决方案 »

  1.   

    选择“嵌入的资源”,而不是"Resource"
      

  2.   

    两种方案:
    1、你将Wildlife.wmv文件移到Silverlight中。
    2、你将MediaElement的Source设置为Wildlife.wmv的URL路径。
      

  3.   

    我刚接触sl 你的第一个方案不知道怎么弄。但我试了第二个 你看  <UserControl x:Class="SilverlightApplication3.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">    <Grid x:Name="LayoutRoot" Background="White">
            <MediaElement Height="120" HorizontalAlignment="Left" Margin="10,10,0,0" Name="mediaElement1" VerticalAlignment="Top" Width="160" Source="D:\Documents\Downloads\02.wmv" 
                          AutoPlay="True"/>
        </Grid>
    </UserControl>
      

  4.   

    我刚接触sl 你的第一个方案不知道怎么弄。但我试了第二个 你看  <UserControl x:Class="SilverlightApplication3.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">    <Grid x:Name="LayoutRoot" Background="White">
            <MediaElement Height="120" HorizontalAlignment="Left" Margin="10,10,0,0" Name="mediaElement1" VerticalAlignment="Top" Width="160" Source="D:\Documents\Downloads\02.wmv" 
                          AutoPlay="True"/>
        </Grid>
    </UserControl>
    你的*.wmv是在Asp.net程序中的,所以URL应该是你的Asp.net程序的URL加上你的*.wmv
      

  5.   

    我刚接触sl 你的第一个方案不知道怎么弄。但我试了第二个 你看  <UserControl x:Class="SilverlightApplication3.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">    <Grid x:Name="LayoutRoot" Background="White">
            <MediaElement Height="120" HorizontalAlignment="Left" Margin="10,10,0,0" Name="mediaElement1" VerticalAlignment="Top" Width="160" Source="D:\Documents\Downloads\02.wmv" 
                          AutoPlay="True"/>
        </Grid>
    </UserControl>
    你的*.wmv是在Asp.net程序中的,所以URL应该是你的Asp.net程序的URL加上你的*.wmv
    那我这样应该是你说的 正确的方法了么。但页面还是一片空白。    <Grid x:Name="LayoutRoot" Background="White">
            <MediaElement Height="120" HorizontalAlignment="Left" Margin="10,10,0,0" Name="mediaElement1" VerticalAlignment="Top" Width="160" 
                          Source="D:\documents\visual studio 2010\Projects\SilverlightApplication3\SilverlightApplication3.Web\02.wmv" 
                          AutoPlay="True"/>
        </Grid>
      

  6.   

    代码中的img是上传图片 。放错地方了。这里重新传
      

  7.   

    昨天就是看着书边弄。到这个MediaElement控件播放视频就出这毛病了。
      

  8.   

    把视频放到ClientBin文件夹下面 。然后Source="*.wmv" 我重新试了可以播放。应该就是llhccyc说的(你将Wildlife.wmv文件移到Silverlight中。)。视频完全不要设置什么Resourc 或者 嵌入的资源之类的。当然。我又弄个视频。设置其属性了也没错。一样可以播放。我也不知道是不是书的问题,还是人品问题,对于我这新手跟着书跑的。真是坑死了。也罢。问题解决了。分享与此。给同样问题的人一个参考