API Reference

Screen Mirror

Mirror the device screen to the web UI and dispatch touch gestures back to the device. Requires the PlainApp Accessibility service for control input.

Type Definitions

bash
type ScreenMirrorQuality {
  mode: ScreenMirrorMode!       # SMOOTH (720p) | HD (1080p)
  resolution: Int!
}

type ScreenMirrorVideoCodec {
  # Hardware/software video codec name used by the active mirror session.
  # Platform-dependent; see PlainApp source for the full list.
}

enum ScreenMirrorMode {
  SMOOTH
  HD
}

enum ScreenMirrorControlAction {
  CLICK
  LONG_PRESS
  SCROLL
  SWIPE
  TEXT
  BACK
  HOME
  RECENT
  POWER_DIALOG
  VOLUME_UP
  VOLUME_DOWN
  NOTIFICATIONS
  QUICK_SETTINGS
  LOCK_SCREEN
  SCREENSHOT
}

input ScreenMirrorControlInput {
  action: ScreenMirrorControlAction!
  x: Float
  y: Float
  x2: Float
  y2: Float
  text: String
}

Operations

query

screenMirrorState

Returns true when a screen mirror session is currently running.

bash
query GetScreenMirrorState {
  screenMirrorState
}
query

screenMirrorVideoCodec

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

bash
query GetScreenMirrorVideoCodec {
  screenMirrorVideoCodec { name }
}
query

screenMirrorControlEnabled

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

bash
query GetScreenMirrorControlEnabled {
  screenMirrorControlEnabled
}
query

screenMirrorQuality

Get the current mirror quality preset.

bash
query GetScreenMirrorQuality {
  screenMirrorQuality { mode resolution }
}
mutation

startScreenMirror

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

bash
mutation StartScreenMirror($audio: Boolean!) {
  startScreenMirror(audio: $audio)
}
mutation

requestScreenMirrorAudio

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

bash
mutation RequestScreenMirrorAudio {
  requestScreenMirrorAudio
}
mutation

stopScreenMirror

Stop the active screen mirror session.

bash
mutation StopScreenMirror {
  stopScreenMirror
}
mutation

updateScreenMirrorQuality

Switch the mirror quality preset. SMOOTH targets 720p, HD targets 1080p.

bash
mutation UpdateScreenMirrorQuality($mode: ScreenMirrorMode!) {
  updateScreenMirrorQuality(mode: $mode)
}
mutation

sendScreenMirrorControl

Dispatch a touch gesture or key event to the device. Requires the PlainApp Accessibility service to be enabled.

bash
mutation SendScreenMirrorControl($input: ScreenMirrorControlInput!) {
  sendScreenMirrorControl(input: $input)
}