nexxPLAY for Android
nexxPLAY for android is a native Player, that is intended to work in native android Apps
Last updated
nexxPLAY for android is a native Player, that is intended to work in native android Apps
Last updated
In this Section, you will find all necessary basic Steps to integrate the nexxPLAY SDK to your native android App.
Please notice - 3Q also provides a sample App, that you can find here:
First add the 3Q Repository to the Apps allprojects
Gradle Definition.
Add the Dependency for nexxPLAY in the Apps build.gradle:
Make sure, that every Activity, that uses nexxPLAY handles configChanges:
nexxPLAY needs a root anchor view which should be a FrameLayout. Please add something likes this to your layout, depending on your needs:
nexxPLAY needs a single view. The root view is the view group where the media player control layout (the player skin) is shown. Also the player needs the Acitivity's window
You can also use the NexxPlayProvider Singleton, if you prefer a synchronized Singleton Approach:
The NexxPLAYEnvironment object contains global settings for the player object. Except for the domain
all the settings are optional and have a predefined value. The settings are:
On TV, the Player will always start in Fullscreen (unless its Audio and respectViewSizeForAudio is set to 1). Therefore, "alwaysInFullscreen" and "showCloseButtonOnFullscreen" have no Effect.
Just like the Javascript Player, the Player can be configured by a Configuration Object. This Object will be used in one of the various play() Methods of the SDK.
All Options are identical to the general SDK Override Options, you will find here:
Please notice, that some Options only make sense in the Web and are therefore not supported.
In case of "starting the Player muted", please notice the special Overrides for native Players on the same link.
If you are looking for the TCF Consent String Management, this is documented here:
nexxPLAY for android also supports Playback of previously downloaded Media Items and therefore offers some SDK Methods to manage localMedia.
This Feature must be enabled within nexxOMNA. Furthermore, various Settings to finetune the Details of the localMedia Behaviour can be setup there. Contact 3Q for more Information.
Just like the Javascript Player, the Player emits all Events to a Listener Function, that can be configured as outlined below. The Player Class has to implement the NexxPLAYNotification.Listener Interface in this case.
nexxPLAY supports Video Ads on all Platforms. This is handled internally with the Google IMA Framework. To minimize the Google Footprint in the Android Manifests, nexxPLAY seperates the Ad Functionality from the main SDK since Version 6.3.00.
To support Ads, just add a Reference to the latest AdManager SDK and add a Reference to the Player Environment like the following:
nexxPLAY for android works identical on mobile Devices as on Phones - unless the Platform demands different Behaviour. Most significantly, you must support Remote Control Input and forward it to the Player:
As it is common on TV to show the Player in Fullscreen, the Overrides "alwaysInFullscreen" and "showCloseButtonOnFullscreen" are ignored on this Platform.
In case the Player will use Audio Contents on TV, it might make sense to not use it Fullscreen. Use the Configuration Option "respectViewSizeForAudio" in this Case.
nexxPLAY for Android TV also support the "WatchNext" System, if possible (GoogleTV needs a manual Review for this Feature).
In order to make this work, a valid contentURITemplate and contentIDTemplate must be set. This can be done either within nexxOMNIA or via the Environment Settings.
Please notice, that nexxOMNIA can also manage the Channel Rows on androidTV. For this, you must also add the "Channel Widget" to your Project (see below).
To enable Picture-in-Picture (on mobile, Tablet and/or TV) add the following code:
Picture-in-Picture must also be declared in the App Manifest, at least like this:
android:supportsPictureInPicture="true"
Picture-in-Picture also requires to be enabled in nexxOMNIA Player Settings and/or Configuration with Overrides.
Additionally, it may not be available on all Devices, depending on Hardware Capabilities.
nexxPLAY for android supports Chromecast and Casting on mobile and Tablet Devices.
Chromecast can only be used, if 3Q adds this Module to the target Domain. If Chromecast Module is enabled, follow these Implementation Steps to enable Chromecast also in the android App.
First, add the Chromecast Receiver Application ID (from 3Q) to your "res/values/strings.xml":
Add the latest Cast Framework to the build.gradle of the App:
Add the nexxPLAY CastOptionsProvider Class as MetaData to the Manifest:
Within the main Application, as early as possible and in the "onCreate" Method, initiate the CastContext, provided by Google Play Services and save it. This CastContext should be used then every time, nexxPLAY is initiated.
Every time, the Application starts a new nexxPLAY Instance, set NexxPLAYEnvironment.castContext to the captured CastContext (mCastContext in this Example). The rest will be handled by nexxPLAY internally.
normally, there is no need to handle MediaSession and TransportControl app-wise, as nexxPLAY will handle this automatically and initiate/terminate the necessary Objects and States corresponding to Config and System Capabilities.
If your App needs a consistent MediaSession though (for example for Assistant Commands), you can use the Environment Options mediaSession and send your Global MediaSession to the Player, whenever it is initiated. In this case, the Player will NOT terminate the Session, even if it will be destroyed. Nevertheless, as the Player changes the Callbacks of the MediaSession, your App might have to set the App-related Callbacks later.
In case nexxPLAY received an app-related Command via MediaSession while active, the App will be informed about that via the nexxPLAY Event System.
nexxPLAY will automatically respect the App Notch Settings and expand under it, if defined. If this is desired, configure the App Theme like:
nexxPLAY for android is also supported in Flutter.
The android Platform also supports native Widgets by nexxPLAY.
Attribute
Type
Value
domain
String
the ID of the domain (mandatory)
contentURITemplate
String
a Template to build a valid URL for an App Intent
contentIDTemplate
String
a Template to build a valid ContentID of each Media
sessionID
String
the ID of the current Session
language
String (2-Letter-Code)
the Player Langage, will be computed by the System Language and Domain Settings if omitted
userHash
String
an Identifer of the currently loggedin User
externalUserReference
String
an Identifier of a User, that is not registered by nexxOMNIA
campaign
int
the ID of an existing Campaign of the calling Domain
affiliatePartner
Int
the ID of an existing Affiliate Partner of the calling Domain
deliveryPartner
Int
the ID of an existing DeliveryPartner of the calling Domain
contextReference
String
the Context Reference for this Player (an indication of "where this Player is located" for Reporting)
platformVariant
String
the PlatformVariant for this Player (usefull Values will be given by 3Q)
platformVariantIndex
Int
if platformVariant is not empty, this might further specify the current platform Variant.
appVersion
String
the Version of the App, that includes the SDK (only for Reporting Purposes)
useSSL
[0,1]
set to 0 if the Player should not use SSL (default is 1)
trackingOptOuted
[0,1]
if the App user explicitley opts out of Tracking and this Information is relevant for Ads, set this to 1
consentString
String
in TCF/CMP Envrionments, the Player might need the User Consent String for Ad Calls
alwaysInFullscreen*
[0,1]
initially and always show the Player in Fullscreen (default is 0)
showCloseButtonOnFullscreen*
[0,1]
set to 0, if the Fullscreen should not show a "close" Button (default is 1)
respectViewSizeForAudio
[0,1]
(only for TV) set to 1, if you are using an Audio Player on TV, that is not intended to run Fullscreen.
notificationIcon
Drawable Ressource
if set, the Media Notifcation will show this Icon during Playback
adManager
NexxPLAYAdManager
a Reference to the nexxPLAY AdManager Class (if Ads are desired)
castContext
CastContext
compare Chromecast Support Docs for this Parameter.
mediaSession
MediaSessionCompat
compare Global MediaSession Support Docs for this Parameter