I am playing audio through the background audio player agent. How do I display a progress bar in the foreground indicating what position is the track currently add, like the built-in music player.

有帮助吗?

解决方案

At Rob Crocombe blog you can find how to make a progressbar and use it with Background audio player. It works basing on Dispatcher Timer, which you start along with play button - the music is playing in background, timer is working in main UI and it's updating progres bar.

On the other hand, if you want want to make a slider (to be able to jump to selected position) you can use (as it's showed in blog) SuperSlider from Toolkit or you can customize your own slider as it showed here.

其他提示

I done this same using Media element there i used a progressbar and Dispatcher timer on dispatcher timer tik event i updated the status of progress bar

Windows Phone Background Audio with Slider and Timer

you can find here

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