MediaProviderFinder

Published 2014-10-28 | (Compatible with SDK 3.5 and 2012 models)

Method
MediaProviderArray getMediaProviders()
Provides the list of discovered providers
Parameter None
Return Array of discovered media providers
Exceptions  
Example
var providerArray = serviceapis.mediasharing.mediaproviderfinder.getMediaProviders();
//if there no provider device
if (providerArray.length <= 0) {
    document.write("No media provider device around here");
} else {
    for (i = 0; i < providerArray.length; i++) {
        document.write(providerArray[i].getName());
    }
}
Method
void setMediaProviderFinderCallback(callback)
register a provider discovery event listener
Parameter
callback (in MediaProviderDiscoveryCallback)
called when a new provider is discovered or removed
Return None
Exceptions  
Example
var providerCB = {
    onmediaprovideradded: function (provider) {
        document.write("A device is newly discovered! Its name is " + provider.getName());
    },
    onmediaproviderremoved: function (provider) {
      document.write("A device was gone! Its name was " + provider.getName());
    }
};
// register a callback for monitoring device discovery
serviceapis.mediasharing.mediaproviderfinder.setMediaProviderFinderCallback(providerCB);