Implementing playlists with songs from phone storage [windows phone]

走远了吗. 提交于 2019-12-29 09:03:40

问题


I have been struggling with an issue with my media player windows phone (7) application. The problem is that I can't seem to implement playlists.

What I want to do is play songs from the media library. This article seems pointless.

I've tried getting into the SongCollection class and figure out how to create more of these things. It appears to be impossible (no constructor, can't cast it, can't inherit it).

After that I tried getting an object on the process running the background audio agent that existed in my app (until I discovered it was redundant), and feed the media player one song at a time.

Problem is, I don't know when the media player stopped playing. It works ok as long as my app is in the foreground, but when it is not, everything stops working, only the media player keeps going.

Is there a way I haven't figured out? In the article above they suggest there is a link between the Zune Media Queue, which I presume is the MediaPlayer.Queue property, and various things I can implement, but I just can't figure a way to make it go.


回答1:


You should give up since building your own media player is an impossible mission (been there, done that). You cannot create playlists or edit any information, you cannot replace default event handlers for on-screen music controls, you don't get events for music change in your application unless it is currently running.

Basically, it is really limited in what you can do right now and the situation isn't much better with WP8.

I hope that it will be less read-only by the time we get Windows Phone 9.




回答2:


Take a look at the UWP samples from Microsoft: https://github.com/Microsoft/Windows-universal-samples

The sample contains play/pause/playlists explanation. This was already possible in Windows phone 7.5/8/8.1



来源:https://stackoverflow.com/questions/15019526/implementing-playlists-with-songs-from-phone-storage-windows-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!