简体   繁体   English

如何在C#silverlight Windows Mobile 7应用程序中快进快退我的媒体播放器?

[英]How to fast forward rewind my media player in C# silverlight windows mobile 7 app?

What I am making I am making a C# Silverlight Windows Mobile 7.5 Media player and I am using Medialibrary class. 我正在做什么我正在制作 C#Silverlight Windows Mobile 7.5 Media Player,并且正在使用Medialibrary类。 It is a simple media player and all it does is plays audio files(not video yet) stored on the phone in the zune library. 这是一个简单的媒体播放器,它所做的只是播放存储在手机中zune库中的音频文件(尚无视频)。

The Problem Other things are going well but now I am stuck. 问题其他事情进展顺利,但现在我被困住了。 There seems to be no way to provide a user with a Fast Forward / Rewind button. 似乎无法为用户提供“快进/快退”按钮。 I can go to next track but the only way to fast forward, rewind or scrub through the song is to press the volume keys and a menu comes up which is windows phone's own built in menu. 我可以转到下一首曲目,但是快速前进,倒带或滚动查看歌曲的唯一方法是按音量键,然后出现一个菜单,这是Windows Phone自带的内置菜单。

What I tried so far I looked at audiobackgroundservice but that seems to be only for streaming media and can only access isolated storage and cant even access zune songs library. 到目前为止,我一直在尝试使用audiobackgroundservice,但这似乎仅用于流媒体,并且只能访问隔离存储,甚至不能访问zune歌曲库。

Blaming Gates as always This is such a simple thing, i cannot believe microsoft didnt provide the functionality to scrub through a song or fast forwarding/rewinding with code??????? 一如既往地责骂盖茨这是一件很简单的事情,我不敢相信Microsoft没有提供通过歌曲进行擦洗或使用代码快速前进/后退的功能?

Thanks 谢谢

Did you change the position property of the player in your audio task. 您是否在音频任务中更改了播放器的position属性。 You need to call FastForward and Rewind within these functions. 您需要在这些函数中调用FastForward和Rewind。 And you also need to handle the Seek action and within there set the player's Position property to the value of param (passed as an argument only when a seek is specified). 而且,您还需要处理“寻找”动作,并在其中将玩家的“位置”属性设置为param的值(仅当指定“寻找”时才作为参数传递)。 This will give you the functionality you want. 这将为您提供所需的功能。

You have to react to the FastForward or Rewind Action in the OnUserAction Callback. 你必须作出反应, FastForwardRewind的操作OnUserAction回调。

From Documentation : 从文档

User actions do not automatically make any changes in system state; 用户操作不会自动对系统状态进行任何更改。 the agent is responsible for carrying out the user actions if they are supported. 如果支持,则代理负责执行用户操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM