0

我正在开发用于视频播放的 Windows Phone 8 应用程序。视频开始后,我希望用户能够在视频之间切换而无需退出MediaPlayerLauncher. 因此,我正在考虑在 windows phone 为视频显示的 3 个控件(倒带、暂停、快进)之上添加第四个控件。我查看MediaPlaybackControls并看到它也有一个用于跳过的控件。因此,我在代码中添加了以下行来显示 Skip 控件。

MediaPlayerLauncher launcher = new MediaPlayerLauncher();
launcher.Media = entry.Uri;
launcher.Controls = MediaPlaybackControls.Rewind | MediaPlaybackControls.Pause | 
                     MediaPlaybackControls.FastForward | MediaPlaybackControls.Skip;
launcher.Show();

entry.Uri 是我要播放的视频的 URI。我希望在播放视频时显示所有 4 个控件,但只显示原始的 3 个控件。我还注意到,无法为MediaPlayerLauncher对象指定多个视频文件,因为 Media 字段只接受一个 URI。

所以有人可以帮助我如何显示“跳过”控件以及“倒带”、“暂停”和“快进”,以及如何在按下“跳过”后切换视频。

谢谢。

4

2 回答 2

0

MediaPlayerLauncher isn't really meant for that usecase. And even at this usecase it does an "OK job". For example MediaPlayerLauncher doesn't support titles, subtitles, overlays, etc.

If you're trying to playback a list of items or want a tailored UI/UX for your media playback experience it's best to use SmfPlayer which in turn uses the built-in MediaElement or SmoothStreamingMediaElement.

For example, here's how to create a playlist of several items with SmfPlayer for WP7:

<Core:SMFPlayer>
    <Core:SMFPlayer.Playlist>
        <Media:PlaylistItem MediaSource="http://smf.vertigo.com/videos/wildlife.wmv"/>
        <Media:PlaylistItem MediaSource="http://smf.vertigo.com/videos/wildlife.wmv"/>
        <Media:PlaylistItem DeliveryMethod="AdaptiveStreaming" MediaSource="http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/bbbwp7/big buck bunny.ism/manifest"/>
    </Core:SMFPlayer.Playlist>
</Core:SMFPlayer> 
于 2012-12-21T22:18:43.460 回答
0

简单的答案是你不能。对于这种情况,您应该MediaElement在您的应用程序中使用。

但是,您将需要在您的应用程序中自己构建控件。

于 2012-12-21T09:25:22.317 回答