-
Deprecated ClassesClassDescriptionNo longer used.
MediaServicenow owns a Media3 session that tracks the player itself, including metadata and artwork. Constructing this class still opens a legacy session, so don't.
-
Deprecated FieldsFieldDescriptionNo longer used. The media session is now a Media3 session owned by this service. Always
null.No longer used.No longer used; the media session is owned byMediaService.
-
Deprecated MethodsMethodDescriptionNo longer called by the SDK;
MediaServiceControllerstarts the session when it connects. Media3 decides when the service enters the foreground (while playing).mediaSessionHelperis destroyed, since it would open a second, legacy session.No longer called by the SDK; useMediaServiceController.updateServiceMediaApi(ServiceMediaApi). Media3 updates the notification itself whenever the player state or metadata changes.No longer used: the helper is destroyed when the controller is built, because constructing it opens a legacy media session. The media session is now a Media3 session owned byMediaService; customise transport behaviour withMediaServiceController.Builder.serviceMediaApi(ServiceMediaApi)instead.OverrideServiceMediaApi.getNotificationButtons(Context)instead. Still honoured: the SDK calls this on a scratch builder each time it reads the buttons, and turns each added action into a button with the same icon and title, in the same order. Tapping it sends the action's ownPendingIntent, as before; an action with a null intent is shown but does nothing. An action whose intent isServiceMediaApi.getActionIntent(android.content.Context, int)for a media key becomes the native control for that key. In the notification itself the action's intent is fired directly, as before; from the lock screen, Android 13+ system controls, Bluetooth or Auto the SDK sends it on the user's behalf.An override runs on the main thread on every relevant player event (state, item, metadata changes), so keep it cheap and free of side effects, and return the same
PendingIntents each time (same request code, noFLAG_CANCEL_CURRENT): the SDK identifies an action by its intent and title, so a new intent per call makes the button look new on every refresh. The actions are rendered exactly as added, play/pause only if you add it. Android 12 and below show at most 5 actions in the expanded notification; later ones are dropped, so put the important ones first.Limits: only the actions carry over; everything else set on the builder (text, style, colour, large icon, ...) is ignored, since the notification is built from the media session. The icon must be a drawable resource; an action with any other icon is skipped. Below Android 13 the notification's own buttons fire the intent directly, so an Activity intent opens as before. Android 13+ system media controls, the lock screen, Bluetooth and Auto press the button through the media session instead, and the SDK sends the intent for the user: Android blocks an Activity
PendingIntentstarted that way while the app is in the background (verified on Android 15). Use a broadcast intent, or theServiceMediaApi.onNotificationButtonClick(String)callback, for actions that must work there; a service intent is subject to Android 8+ background start limits when the app is not in the foreground.Give buttons aNotificationButton.Builder.compactViewIndex(int)inServiceMediaApi.getNotificationButtons(Context)instead. Still honoured for the actions fromServiceMediaApi.addNotificationActions(android.content.Context, androidx.core.app.NotificationCompat.Builder): the first three entries are used, and each index, into those actions in the order they were added, puts that action at that position in the compact view. An override is honoured exactly; with the default, play/pause is always in the compact view.This API has been deprecated, override the key jwplayer_next_up_countdown in strings.xml to customize this message.This API has been deprecated, override the key jwplayer_next_up_countdown in strings.xml to customize this message.does not say which download failed, which matters because several downloads run at once. OverrideMediaDownloadResultListener.onMediaDownloadFailed(String, Exception)as well - the SDK calls that one, and its default implementation forwards here, so existing code keeps working unchanged whether or not it adopts the newer method.
MediaServiceitself.