Plug-in Overview

This plug-in enables your app to discover and control nearby UPnP and AirPlay media devices. This is an early release, experimental plug-in with limited functionality (e.g., AirPlay is limited to device discovery at present).

  • Plug-in ID: org.ambientdynamix.contextplugins.ambientmedia

Supported Context Types

Context Types Privacy Risk Level Data Types Description
<PLUGID>.discovery LOW IMediaDeviceInfo Details about discovered media devices.
<PLUGID>.interaction LOW IAmbientMediaResult Results for device interaction requests.
Descriptions of the data types above can be found in the JavaDocs at the end of this page.

Web App Usage

Integrate Dynamix into your Web app, as described here.

Add context support as follows:

Your app will automatically receive an event whenever ambient media devices are discovered. You can also register to control ambient media devices like this:

See the JavaDocs below for details on the available context event data. Context events can be handled like this in your Web app’s dynamix_listener.js file:

Using the device identifiers provided by context events (see above), you can playback media URIs like this:

You can stop media playback like this:

Native App Usage

Integrate Dynamix into your native app, as described here.

Add context support as follows:

Your app will automatically receive an event whenever ambient media devices are discovered. You can also register to control ambient media devices like this:

[DataType JAR Download data-type-download=””]

Context events can be handled like this:

Using the device identifiers provided by context events (see above), you can playback media URIs like this:

You can stop media playback like this:

JavaDocs

Web apps

Web apps will receive context events with additional JavaScript properties, which are automatically derived from the IBatteryLevelInfo interface described in the JavaDocs below if the methods adhere to JavaBean getter conventions. The available JavaScript properties can be derived as follows:

  • Remove each method’s ‘get’ prefix.
  • Remove each method’s trailing parentheses ‘()’.
  • Convert the result to camel case.
  • Example: event.getSomeProperty() would be available in JavaScript as event.someProperty;

Native apps

Native apps can use the interface below directly, if the plug-in’s data-type JAR is included on the app’s build path and exported into the app’s APK.

JavaDocs