画面ミラーリング
機能の対応状況は app.capabilities、認可は app.access とホストの権限で確認してください。例は合成値を使用しています。呼び出す前にパス、ID、入力、フィルターを置き換えてください。
型定義
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
}操作
screenMirrorState
現在の画面ミラーリング状態を読み取ります。
subscription screenMirrorState {
screenMirrorState { running }
}screenMirrorVideoCodec
画面ミラーリングセッションの動画コーデック設定の更新を受信します。
subscription screenMirrorVideoCodec {
screenMirrorVideoCodec { annexB }
}screenMirrorAudioGranted
画面ミラーリング音声の権限が許可された通知を受信します。
subscription screenMirrorAudioGranted {
screenMirrorAudioGranted
}openAccessibilitySettings
デバイス上で Android のユーザー補助設定画面を開きます。sendScreenMirrorControl がジェスチャーを送る前に必要です。
mutation openAccessibilitySettings {
openAccessibilitySettings
}requestScreenMirrorAudio
画面ミラーリング音声用のマイク権限を要求します。すでに許可されていれば true、それ以外は false を返し、権限ダイアログを表示します。
# Returns false when the device has not granted RECORD_AUDIO yet; the
# platform asks for it and the caller retries.
mutation requestScreenMirrorAudio {
requestScreenMirrorAudio
}requestScreenMirrorKeyFrame
実行中の画面ミラーリング動画エンコーダーに新しいキーフレームを要求します。
mutation requestScreenMirrorKeyFrame {
requestScreenMirrorKeyFrame
}startScreenMirror
画面ミラーリングセッションを開始します。デバイス音声も配信するには audio=true を渡します(RECORD_AUDIO 権限が必要)。
mutation startScreenMirror($audio: Boolean!) {
startScreenMirror(audio: $audio)
}stopScreenMirror
実行中の画面ミラーリングセッションを停止します。
mutation stopScreenMirror {
stopScreenMirror
}updateScreenMirrorQuality
画面ミラーリングの画質プリセットを設定します。
mutation updateScreenMirrorQuality($mode: ScreenMirrorMode!) {
updateScreenMirrorQuality(mode: $mode)
}isScreenMirroring
画面ミラーリングセッションが実行中かを確認します。
query isScreenMirroring {
isScreenMirroring
}screenMirrorControlEnabled
PlainApp のユーザー補助サービスが有効で、ジェスチャーを送れる場合は true を返します。
query screenMirrorControlEnabled {
screenMirrorControlEnabled
}screenMirrorQuality
現在のミラーリング画質プリセットを取得します。
query screenMirrorQuality {
screenMirrorQuality { mode resolution }
}screenMirrorVideoCodec
現在または直前のミラーリングセッションで使用した動画コーデックを取得します。
# Null while the pipeline has not published its codec configuration.
query screenMirrorVideoCodec {
screenMirrorVideoCodec { annexB keyFrame }
}