0

我正在使用此页面来保持我的音频跨页面播放。

<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>

这就是我的 App Manifest 的外观。 在此处输入图像描述

但是,一旦我背景化我的应用程序,音频就会停止播放。据我所知,这里提到的所有内容都存在于我的应用程序中

(该MediaPlayer元素应该照顾SystemMediaTransportControls

4

1 回答 1

1

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

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

于 2014-07-29T14:11:10.427 回答