Microsoft Player Framework not playing local files - windows

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

Related

codenameone downloading files/images visible to other apps

I note that other apps (testing on Android) like WhatsApp, etc have folders that contains images the user has used/downloaded. These folders (like WhatsAppImages) are visible in other apps (Gallery/File Explorers, etc) so you can use those files to share, delete, etc like any other file.
In my codenameone app I download image files but they cannot be seen anywhere on the local device. I understand that for security apps run in a sandbox and this may be why.
But how do these other apps make their downloaded files visible to the general file system and other apps ?
Many Thx
Codename One doesn't support that at this time but you can use native interfaces to add this as explained here for Android: How to save image in android gallery
and here for iOS: How can I save an image to the camera roll?
You can also file an RFE to add this either as a cn1lib or API.

WP7 how to use MediaPlayerLauncher with song in library

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.

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'.

WP7 emulator won't play mp4

I was wondering if the format is really supported. I am developing a simple WP7 application which contains a MediaElement such as the one shown bellow:
For the sake of testing, I subscribed for the MediaFailed event and it fires always.
If I try to open the file in the browser, it opens successfully. If I put the same MediaElement in a regular SL application - it runs. If I give some .wmv file to the MediaElement in the WP7 app - it runs. (http://files.ch9.ms/ch9/5baa/ea2aeba2-9dcc-4565-942a-9e6101655baa/DevKid_ch9.wmv).
Got any ideas?
One thing to watch is that video won't play if you're connected using USB to the Zune software.
I just tried your video using this IronRuby script - it plays fine.
For more help, you can check out the Channel9 application on codeplex - that works well.
Windows Phone 7 supports the MP4 container, but only supports a certain set of codecs. I believe this list is a pretty accurate list of what's supported.
It seems that you can't play mp4 files when Zune is running. However, you can still debug your application by connecting to your phone using WPConnect.exe which by default is installed to C:\Program Files\Microsoft SDKs\Windows Phone\v7.0\Tools\WPConnect. You'll need to close Zune before running WPConnect, but after you have run it, you should be able to F5 in Visual Studio and the the debugger running your code on the phone.
One other thing to keep in mind is that Windows Phone 7 requires the file (or URL) extension to match with the codec, so for mp4 files you need to have file name ending with .mp4, otherwise it won't play.

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