Music + Video integration when using BackgroundAudioPlayer.Track/Play vs MediaHistoryItem.NowPlaying - windows-phone-7

According to the MediaHistory.NowPlaying documentation:
For applications using BackgroundAudioPlayer, there is no need to set the NowPlaying information because it is handled by the system automatically
Since AudioTrack does not contain an equivalent to MediaHistoryItem.PlayerContext, how can the application supply additional data so that it can correctly handle navigation from the Music + Video Hub or the Universal Volume Control?

I ended up setting a NowPlaying anyway and had it link to the "now playing" section of my app.
The BackgroundAudioPlayer API may not require you to set NowPlaying, but Music + Video integration does and it's the only way to provide other information (like PlayerContext data).

Related

MediaFoundation capture video while previewing

This says:
A capture device is represented in Media Foundation by a media source object, which exposes the IMFMediaSource interface. In most cases, the application will not use this interface directly, but will use a higher-level API such as the Source Reader to control the capture device.
When I have an IMFMediaSource I can use MFCreateSourceReaderFromMediaSource and create the source reader. However this function fails with MF_E_MULTIPLE_SUBSCRIBERS when I'm also previewing the video I want to capture, which is what I 'd want.
hr = MFCreateSourceReaderFromMediaSource(t.source, 0, &t.rdr); // Fails if I'm previewing, suceeeds when I'm not.
Is there a way to aquire a SourceReader in order to capture video I'm already previewing?
I'm previewing with the Media Session.
Or, if this is not possible, how do I use the IMFMediaSource directly without a source reader? Much like what the embedded Camera application does.
Thanks a lot.
MF_E_MULTIPLE_SUBSCRIBERS part is touched by another question: you cannot have the source managed by Media Session and additionally work with it otherwise.
If you need both you need to either use a tee in that media session and use two legs of the tee to preview and capture.
Alternatively, manage the source yourself and use a custom-developed proxy in the media session to accept data from the source.
Or, if this is not possible, how do I use the IMFMediaSource directly without a source reader? Much like what the embedded Camera application does.
Or just get rid of Media Session, read from media source directly and use the data outside of Media Foundation.
The use pattern is rather straightforward (and repeats what media session or source reader would do on your behalf): create presentation descriptor, set it up, subscrive to events, start, receive samples. This API is fully documented.

azure media service for xamarin?

I have created a console application with azure media service.
in the app i am using the plugin
windowsazure.mediaservices
the way i am doing is
static IAsset CreateAssetAndUploadSingleFile(string filePath, string assetName, AssetCreationOptions options)
{
IAsset asset = _context.Assets.Create(assetName, options);
var assetFile = asset.AssetFiles.Create(Path.GetFileName(filePath));
assetFile.Upload(filePath);
return asset;
}
so i just want to know whether this plugin will work on xamarin(i am not a xamarin devoloper) as its a portable project.
if its not do we have any alternative plugin?
my basic purpose is upload and encode.
That package is for our current .NET SDK
https://www.nuget.org/packages/windowsazure.mediaservices
It does not support .NET Core. See the dependencies.
It's not compiled for Xamarin though, so I don't believe that it works in Xamarin, but i'm not a Xamarin expert at all.
What is your scenario exactly? Why would you want to call the Media Services account directly from Xamarin anyways? You would only need to do that if you are creating a management application for the account Administrator. Otherwise, dont put Media Services directly into any client code! You should hide it in your middle-tier, and only pass Streaming URLs or SAS locators to the client application to upload content to.
For the upload from phone scenario, middle tier should create an Asset, get a writable SAS Locator for the Asset, hand that to the client side. Client can then use Azure Storage APIs to upload the content to that SAS URL directly (it ends up in an Azure storage container then.)
I believe that Xamarin has client side support for the Azure Storage APIs available.
As john answered, you don't do this stuff on a client, you will need to use SaS tokens and what not. I could explain everything here, but there are some nice guides and examples online.
Build 2018 video explaining how it works (including Azure Functions): https://www.youtube.com/watch?v=dEZkQNNpSIQ&feature=youtu.be&rel=0
The github example of this video: https://github.com/Azure-Samples/xamarin-azure-businessreview
To understand it better, I recommend this guide, it is old but it does cover the entire process, just make sure to combine new documentation with this old one.
Old docu: https://learn.microsoft.com/en-us/previous-versions/msp-n-p/dn735912(v%3dpandp.10)
Official current documentation: https://learn.microsoft.com/en-us/azure/media-services/previous/media-services-dotnet-upload-files#upload-multiple-files-with-media-services-net-sdk
Probably useful for new readers.

Chromecast new Cast.Api()

I just started using Chromecast SDK today and got bit confused with its APIs and samples given in the web.
What I am trying to do is to send some messages to the Chromecast so it will display them on the big screen. I am going to use Chrome API with HTML5/JS/CSS.
Most examples (https://github.com/pjjanak/chromecast-hello-world/blob/master/sender/index.html , http://nerdwin15.com/2013/10/chromecast-development-part-one-chrome-sender/) in the web uses new Cast.Api() in the sender and uses an Activity in doing so. But I could not find a reference to a Cast.Api in the Chrome API. Most Google references deal with Media and I am not sure whether I have to use them. So to sum up, following are the questions I have (Sorry! I did read the API and developer guide but I am still clueless).
Do I have to write a custom receiver to show text on TV screen. Can't I survive default receiver, chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
Is handling multimedia files different from displaying text on the Chromecast or can I set the mime type to text/html and send a text stream (doesn't work for me at the moment)
Are those examples on the web uses a deprecated way of sending data to chromecast?
Thanks in advance,
Ish
Ok I think I found the answer from following documents,
https://developers.google.com/cast/docs/receiver_apps
https://github.com/googlecast/CastHelloText-chrome/blob/master/chromehellotext.html
Will try them and let you all know!
Following example page is very useful for anyone who try writing chromecast apps
https://github.com/googlecast
I'm not sure how you fared, but here are some quick responses to your questions.
Yes, you have to write a custom receiver if you want to do anything other than sending images, audio, or video to the Chromecast. You can see a list of supported media Default Media Receiver here: https://developers.google.com/cast/docs/media
Yes (see above), it requires a custom receiver, which will also require your own appId and I'm pretty sure a custom namespace.
To my knowledge, all of the examples up on https://github.com/googlecast should be relevant, but I am working on a few wrappers to try to simplify getting up and running with custom Chrome Sender and Receiver apps. You can check them out here: https://github.com/googlecast Let me know if those help, and if you have any feedback to share.
I hope you've already figured all this stuff out, but if not hopefully this is useful.

switch the cameratype in Windows Phone7

all, as we know, the CameraType property indicates the location of the camera on the device. But when I try to swich the cameratype from Primary to FrontFacing by using the following code, it does not work. After reviewing the MSDN document, I found it was a protected set method. And obviously I have no access permition. Is there any way to do that?
Could any one help me?
Thanks in advance!
camera.CameraType = CameraType.FrontFacing;
It seems like you can't force the camera to a different mode after you initialize it.
Use the constructor of the implementation.
For ex: Constructor of PhotoCamera class
I assume you're trying to create a custom camera app ? or something similar ?
If you just want to capture a picture, use Camera Capture Task instead of this. Otherwise your app will fail certification.
If photo capture is not a core feature of your application, consider using the Camera Capture Task to capture photos instead of using the camera APIs directly. Memory allocated for the Camera Capture Task does not count toward total application memory use. This helps minimize your application’s memory use, which is particularly important when your application runs on a 256-MB device. For more information, see Developing for 256-MB Devices and How to: Use the Camera Capture Task for Windows Phone.

Help me build this tool in windows envoirnment

I made a desktop music application in adobe air.
I want to update the status of some IM clients running EG: Yahoo messenger,Gtalk,AIM,MSN etc.
with the current playing song.
I am not desktop developer.This is first time i am making something for desktop.
SO is there any way in any Programming language that i can make something which will change the Data (Status message) of a running IM client.
Please Just guide me through this problem .
Edit: I dont want to ask for username/password of users IMs accounts , so via API is not a solution in this case .
It will be like Person X running mine music application and also logged to various third party IM clients (YIM,Gtalk etc).
SO if he is playing a song in the music application , then mine app will update presence status message on the IM clients to " Listening to bla bla song ".
So it is like high-jacking/Hacking the data of the running third party IM client.
Have a look at libpurple, it might have the functionality you require.
There is also telepathy, but I think it is related to the former somehow (one uses the other or they do the same thing).
EDIT: for the recent edit: it looks to me like you want something like MSN Messenger displaying the currently playing track in Windows Media Player. This requires a plugin for the messaging client, no way around that.
Perhaps an easier way to get this done would be to develop a plugin for one of the numerous multi-platform IM clients such as GAIM or Trillian. This would let you target stuff across the board without undue effort . . .
I think your only option is to write a plugin for each chat client you want to target, which could take some time.
So let me suggest an alternative: Add last.fm audioscrobbler support to your application. You would simply send the Now Playing info to last.fm via the API (http://www.last.fm/api/submissions), and it will appear on the user's profile page. Most music players already support this method because it's a pretty popular service, and a lot of people link to their last.fm profiles on their blog/facebook/etc.

Resources