我正在使用这个页面,让我的音频跳过页面。

<Page
    x:Class="MyApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MyApp"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:mmppf="using:Microsoft.PlayerFramework"
    mc:Ignorable="d"
    >

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <mmppf:MediaPlayer x:Name="player" AutoPlay="True" AudioCategory="BackgroundCapableMedia" />
        <Frame x:Name="rootFrame"/>
    </Grid>
</Page>
.

这就是我的应用程序清单的样子。

但是一旦我的应用程序,音频就会停止播放。 从我可以看到的,一切 存在于我的应用程序中

MediaPlayer元素应处理SystemMediaTransportControls

有帮助吗?

解决方案

您所指的页面仅适用于Windows Store应用程序,而不是Windows Phone 8.1。

对于Windows Phone 8.1,事情似乎更复杂,因为您必须实现后台任务,如此处所述:概述:背景音频(Windows Phone Store应用程序)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top