当播放器在 MediaElement 上全屏时删除广播图标

Removing the broadcasting icon when player is in fullscreen on MediaElement

我正在使用带有 AreTransportControlsEnabled="True" 的默认 MediaElement,并且我正在尝试在应用全屏显示时删除 CastButton 元素。

我已经创建了 MediaTransportControls 的副本并注释掉了 CastButton 但这在全屏模式下不起作用有什么想法吗?

附上示例项目: https://www.dropbox.com/s/83wt4adr8db7xqu/App1.zip?dl=0

我的代码:

  <Style TargetType="MediaTransportControls">
bla bla
 <ControlTemplate TargetType="MediaTransportControls">
bla
  <!--<AppBarButton x:Name='CastButton'
           Style='{StaticResource AppBarButtonStyle}'
           Visibility="Collapsed"
           MediaTransportControlsHelper.DropoutOrder='7'>
                     <AppBarButton.Icon>
                           <FontIcon Glyph="&#xEC15;"/>
          </AppBarButton>-->

bla bla

我的媒体元素:

     <MediaElement Source="http://smf.blob.core.windows.net/samples/videos/bigbuck.mp4"
                          AreTransportControlsEnabled="True"
                          ></MediaElement>

你几乎完成了。您的 xaml 未合并到您的应用程序的全局字典中的主要原因。就动你xaml码:

  1. App.xaml
  2. 或者创建一些文件,其中将包含您的样式并将此 xaml 样式与 App.xaml
  3. 中的资源字典合并

您可以通过以下代码查看:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Styles/MediaElementStyles.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

我是通过第二种方式做到的。 Your project link