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
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
screenMirrorState
Read the current screen-mirror state.
subscription screenMirrorState {
screenMirrorState { running }
}screenMirrorVideoCodec
Receive video codec configuration updates from the screen-mirroring session.
subscription screenMirrorVideoCodec {
screenMirrorVideoCodec { annexB }
}screenMirrorAudioGranted
Receive notification that screen-mirror audio permission was granted.
subscription screenMirrorAudioGranted {
screenMirrorAudioGranted
}openAccessibilitySettings
Open the Android Accessibility settings screen on the device. Required before sendScreenMirrorControl can dispatch gestures.
mutation openAccessibilitySettings {
openAccessibilitySettings
}requestScreenMirrorAudio
Request microphone permission for screen-mirror audio. Returns true if already granted, false (and triggers a permission dialog) otherwise.
# Returns false when the device has not granted RECORD_AUDIO yet; the
# platform asks for it and the caller retries.
mutation requestScreenMirrorAudio {
requestScreenMirrorAudio
}requestScreenMirrorKeyFrame
Request a fresh key frame from the active screen-mirror video encoder.
mutation requestScreenMirrorKeyFrame {
requestScreenMirrorKeyFrame
}startScreenMirror
Start a screen mirror session. Pass audio=true to also stream device audio (requires RECORD_AUDIO permission).
mutation startScreenMirror($audio: Boolean!) {
startScreenMirror(audio: $audio)
}stopScreenMirror
Stop the active screen mirror session.
mutation stopScreenMirror {
stopScreenMirror
}updateScreenMirrorQuality
Set the screen-mirror quality preset.
mutation updateScreenMirrorQuality($mode: ScreenMirrorMode!) {
updateScreenMirrorQuality(mode: $mode)
}isScreenMirroring
Check whether a screen-mirror session is active.
query isScreenMirroring {
isScreenMirroring
}screenMirrorControlEnabled
Returns true when the PlainApp Accessibility service is enabled and can dispatch gestures.
query screenMirrorControlEnabled {
screenMirrorControlEnabled
}screenMirrorQuality
Get the current mirror quality preset.
query screenMirrorQuality {
screenMirrorQuality { mode resolution }
}screenMirrorVideoCodec
Get the video codec used by the current/last mirror session.
# Null while the pipeline has not published its codec configuration.
query screenMirrorVideoCodec {
screenMirrorVideoCodec { annexB keyFrame }
}