我在我的应用程序中使用此xaml来录制视频和播放。除了视频以90度旋转形式播放外,一切正常。 :
<phone:PhoneApplicationPage
x:Class="RecoedVedio.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" x:Name="PhoneAppBar" Opacity="0.0">
<shell:ApplicationBarIconButton IconUri="/Assets/AppBar/feature.video.png" Text="record" x:Name="StartRecording" Click="StartRecording_Click" />
<shell:ApplicationBarIconButton IconUri="/Assets/AppBar/stop.png" Text="stop" x:Name="StopPlaybackRecording" Click="StopPlaybackRecording_Click"/>
<shell:ApplicationBarIconButton IconUri="/Assets/AppBar/transport.play.png" Text="play" x:Name="StartPlayback" Click="StartPlayback_Click" />
<shell:ApplicationBarIconButton IconUri="/Assets/AppBar/transport.pause.png" Text="pause" x:Name="PausePlayback" Click="PausePlayback_Click"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
<!--LayoutRoot is the root grid where all page content is placed-->
<Canvas x:Name="LayoutRoot" Background="Transparent">
<!--Camera viewfinder >-->
<Rectangle x:Name="viewfinderRectangle" Width="460" Height="661" HorizontalAlignment="Left" Canvas.Left="10" Canvas.Top="10"/>
<MediaElement x:Name="VideoPlayer" AutoPlay="True" RenderTransformOrigin="0.5, 0.5" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="UniformToFill" Canvas.Left="10" Canvas.Top="10"/>
<!--Used for debugging >-->
<TextBlock
Height="40"
HorizontalAlignment="Left"
Name="txtDebug"
VerticalAlignment="Top"
Width="414"
FontSize="24"
FontWeight="ExtraBold" Canvas.Left="42" Canvas.Top="616"/>
</Canvas>
</phone:PhoneApplicationPage>
但是当我以纵向录制视频时,屏幕上显示的视频会旋转90度。 任何人都可以告诉我我在哪里做错了吗? 帮助赞赏。