API Reference

Screen Mirror

Check app.capabilities for feature support and app.access plus host permissions for authorization. Examples use synthetic values; replace paths, IDs, inputs and filters before calling.

Type Definitions

graphql
type Subscription {
  screenMirrorState: MirrorState!
  screenMirrorVideoCodec: MirrorCodecConfiguration
  screenMirrorAudioGranted: Boolean!
}

type Mutation {
  openAccessibilitySettings: Boolean!
  requestScreenMirrorAudio: Boolean!
  requestScreenMirrorKeyFrame: Boolean!
  startScreenMirror(audio: Boolean!): Boolean!
  stopScreenMirror: Boolean!
  updateScreenMirrorQuality(mode: ScreenMirrorMode!): Boolean!
}

type Query {
  isScreenMirroring: Boolean!
  screenMirrorControlEnabled: Boolean!
  screenMirrorQuality: ScreenMirrorQuality!
  screenMirrorVideoCodec: ScreenMirrorVideoCodec
}

type MirrorCodecConfiguration {
	annexB: String!
}

type MirrorState {
	running: Boolean!
}

enum ScreenMirrorMode {
	HD
	SMOOTH
}

type ScreenMirrorQuality {
	mode: ScreenMirrorMode!
	resolution: Int!
}

type ScreenMirrorVideoCodec {
	
	annexB: String!
	
	keyFrame: String
}

Operations

subscription

screenMirrorState

Read the current screen-mirror state.

graphql
subscription screenMirrorState {
  screenMirrorState { running }
}
subscription

screenMirrorVideoCodec

Receive video codec configuration updates from the screen-mirroring session.

graphql
subscription screenMirrorVideoCodec {
  screenMirrorVideoCodec { annexB }
}
subscription

screenMirrorAudioGranted

Receive notification that screen-mirror audio permission was granted.

graphql
subscription screenMirrorAudioGranted {
  screenMirrorAudioGranted
}
mutation

openAccessibilitySettings

Open the Android Accessibility settings screen on the device. Required before sendScreenMirrorControl can dispatch gestures.

graphql
mutation openAccessibilitySettings {
  openAccessibilitySettings
}
mutation

requestScreenMirrorAudio

Request microphone permission for screen-mirror audio. Returns true if already granted, false (and triggers a permission dialog) otherwise.

graphql
# Returns false when the device has not granted RECORD_AUDIO yet; the
# platform asks for it and the caller retries.
mutation requestScreenMirrorAudio {
  requestScreenMirrorAudio
}
mutation

requestScreenMirrorKeyFrame

Request a fresh key frame from the active screen-mirror video encoder.

graphql
mutation requestScreenMirrorKeyFrame {
  requestScreenMirrorKeyFrame
}
mutation

startScreenMirror

Start a screen mirror session. Pass audio=true to also stream device audio (requires RECORD_AUDIO permission).

graphql
mutation startScreenMirror($audio: Boolean!) {
  startScreenMirror(audio: $audio)
}
mutation

stopScreenMirror

Stop the active screen mirror session.

graphql
mutation stopScreenMirror {
  stopScreenMirror
}
mutation

updateScreenMirrorQuality

Set the screen-mirror quality preset.

graphql
mutation updateScreenMirrorQuality($mode: ScreenMirrorMode!) {
  updateScreenMirrorQuality(mode: $mode)
}
query

isScreenMirroring

Check whether a screen-mirror session is active.

graphql
query isScreenMirroring {
  isScreenMirroring
}
query

screenMirrorControlEnabled

Returns true when the PlainApp Accessibility service is enabled and can dispatch gestures.

graphql
query screenMirrorControlEnabled {
  screenMirrorControlEnabled
}
query

screenMirrorQuality

Get the current mirror quality preset.

graphql
query screenMirrorQuality {
  screenMirrorQuality { mode resolution }
}
query

screenMirrorVideoCodec

Get the video codec used by the current/last mirror session.

graphql
# Null while the pipeline has not published its codec configuration.
query screenMirrorVideoCodec {
  screenMirrorVideoCodec { annexB keyFrame }
}