WP7 how to use MediaPlayerLauncher with song in library - windows-phone-7

This article says that
MediaPlayerLauncher launches the Media Player application and plays
the specified media file. Media files are stored in isolated storage
or in the application's installation directory.
However, I want to select songs from a certain album from library (using MediaLibrary) and launch the default Media player to play it. How to do this ?

Basically you can't do that with the current API.
The MediaPlayerLauncher takes a parameter of type
MediaLocationType,
and from the documentation we can see that there's no option to access the media library
Use MediaLocationType.Data for media files that are stored in isolated storage. Use MediaLocationType.Install for media files that are part of the application project. They are bundled into the .xap file and stored in the installation directory of the application.
I've created a UserVoice request for this feature. Hopefully we'll get it with the next update if enough people vote for it.

Related

Save pictures to custom folder in media library

WhatsApp now saves pictures to a custom folder named "WhatsApp" in the media library.
Is WhatsApp using a undocumented API or is this possible for every developer?
Right now I am only aware of the possibility to save pictures to the "Camera Roll" or to the "Saved Pictures".
It appears WhatsApp has special permission to do that as no current APIs for Windows Phone 8 (with GDR3) allow you to specify a folder name.
The hope is that Windows Phone 8.1 will introduce new APIs for both saving pictures and video.

Microsoft Player Framework not playing local files

I am developing a windows 8 app in winjs and one of its features is to be able to play local video files. So far I am using:
Windows.System.Launcher.launchFileAsync
Which works fine but obviously suspends the app and opens the video with their default video program. I would rather keep the user in the app so I tried to implement it using the Microsoft Player Framework(http://playerframework.codeplex.com/). I know the framework is referenced correctly etc because it can play video files both in the 'app data' directory and online.
However when I try to play files within a folder that the user has picked (with the folder picker) or the videos library that the app has declared access to, the video fails to play. The app can however change the name, create new files in the directory and delete files so I struggle to see a permissions problem.
To get the path of the file I am using getFileAsync( and using the path property and simply using that to set the src property of the MediaPlayer control.
Do any windows 8 app gurus have any suggestions as to why it is not working?
Thanks in advance
p.s. let me know if any further info is required

Window Phone 8 - Default Media player file url scheme

Is it possible to open the default Media Player in Windows Phone 8, from a browser's url, using some kind of scheme?
I would also like to know If there are other ways to open the media player from the browser.
Thanks!
There's nothing documented on MSDN as a registered URI scheme for the launching default media player.
As per this MSDN page about file type associations if you try and link to a .MP3 or .AAC file or other audio or video file it will launch the media player and play the file you point to.
Also it states:
Sometimes Internet Explorer overrides file associations: it launches the built-in media player to handle all music and video file types. Specifically, any file that has an audio/ or video/ content type. For example, your app can handle a (non-reserved) music and video file when it is launched from an email attachment. But if the same file is launched from Internet Explorer, the built-in media player will handle the file.

wp7 player freezes if html5 <video> and isolated storage

I have video file located in my application isolated storage and would like to play it from html using video tag. Video player runs and then hangs on "loading..". Can someone manage to get video played using html5 video tag and isolated storage?
My observations and tests (HTC HD7, Mango Beta 2 - 7.10.7712.60).
I can play this video file using MediaElement or MediaPlayerLauncher. So the file is correct.
If I publish this file in internet and change reference to absolute (src="http://absoluteUri.mp4") video file is opened correctly. So it seems there is a problem with relative path and isolated storage.
If i specify incorrect relative path I see another message so relative path in my experiments is correct.
audio html5 tag works with isolated storage files very well; video - doesn't (freezes) but works correct if I reference to audio file in internet
For "/folder/video.mp4" and "\folder\video.mp4" device opens different playback screens, but both freeze with 'loading' and 'opening' messages.
There is MediaPlayerLauncher C# class that works with "folder/video.mp4" name (doesn't freeze)and does not work with leading slash in path - "/folder/video.mp4" - throws file not found; contrariwise tag can't find file w/o leading slash, even in root folder.
Playback screens triggered by MediaPlayerLauncher and html tag look identical but in first case it works and in second it freezes.
EDIT:
Application overview: the app is general Windows Phone Silverlight app with embedded WebBrowser control where html is hosted. Why I need this? - I'm working on cross-mobile platform where application is defined as html + js.
Erick Fleck covers this pretty good at the MSDN forums in this blog post - http://social.msdn.microsoft.com/forums/en-us/wpdevelop/thread/190abd75-3b45-4454-96ab-c32fb19c4664 . Looks like it comes down to 'where you store your content', so the other apps would have to adapt their structure if you want it to be truly xplat. Or you could do some 'adaptive urls'.

Storing a QTMovie file to launch on Startup of App

I'm trying to build a simple app for OSX using cocoa and the Qtkit. I would like to have a movie start playing as soon as the app is launched. I've created an app to play which can play a .mov file on my located on my desktop, by referencing the location of the file.
I would of course like to store the .mov file within the app itself, so that it will play the specific file when the user launches the app, but I am not sure where or how to store it. Should I use the Core Data library? Thank you.
No. There might be a reason to store a movie in a Core Data store, but this isn't it.
Store the movie file within your application's bundle, and use NSBundle or CFBundle to retrieve the URL to it to pass to QTKit.

Resources