YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
Classes | Static Public Member Functions | Static Public Attributes | List of all members
de.yaacc.upnp.server.media.MediaProjectionHelper Class Reference

Manages MediaProjection for capturing system audio and screen. More...

Collaboration diagram for de.yaacc.upnp.server.media.MediaProjectionHelper:
Collaboration graph

Classes

interface  MediaProjectionStopCallback
 

Static Public Member Functions

static void setStopCallback (MediaProjectionStopCallback callback)
 Set callback for when MediaProjection stops.
 
static Intent createPermissionIntent (Context context)
 Create intent to request MediaProjection permission.
 
static boolean handlePermissionResult (Context context, int resultCode, Intent data)
 Handle permission result from activity.
 
static boolean createMediaProjectionFromStored (Context context)
 Create MediaProjection from a foreground service using stored permission.
 
static boolean createMediaProjection (Context context, int resultCode, Intent data)
 Create MediaProjection from a foreground service.
 
static MediaProjection getMediaProjection ()
 Get current MediaProjection instance.
 
static boolean isActive ()
 Check if MediaProjection is active.
 
static boolean hasPermission ()
 Check if we have stored permission (either active or pending).
 
static void clearPermission ()
 Clear stored MediaProjection permission.
 
static void stopMediaProjection ()
 Stop MediaProjection and release resources.
 

Static Public Attributes

static final int REQUEST_CODE_MEDIA_PROJECTION = 2001
 

Detailed Description

Manages MediaProjection for capturing system audio and screen.

Requires Android 10+ (API 29).

Author
Tobias Schoene (tobexyz)

Member Function Documentation

◆ createMediaProjection()

static boolean de.yaacc.upnp.server.media.MediaProjectionHelper.createMediaProjection ( Context  context,
int  resultCode,
Intent  data 
)
static

Create MediaProjection from a foreground service.

Must be called from a service with FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION.

◆ createMediaProjectionFromStored()

static boolean de.yaacc.upnp.server.media.MediaProjectionHelper.createMediaProjectionFromStored ( Context  context)
static

Create MediaProjection from a foreground service using stored permission.

Must be called from a service with FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION.

◆ handlePermissionResult()

static boolean de.yaacc.upnp.server.media.MediaProjectionHelper.handlePermissionResult ( Context  context,
int  resultCode,
Intent  data 
)
static

Handle permission result from activity.

Note: MediaProjection must be created from a foreground service.


The documentation for this class was generated from the following file: