Phản chiếu màn hình
Kiểm tra app.capabilities để biết tính năng và app.access cùng quyền máy chủ để xác định quyền truy cập. Thay giá trị mẫu trước khi gọi.
Định nghĩa kiểu
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
}Thao tác
screenMirrorState
Đọc trạng thái phản chiếu màn hình hiện tại.
subscription screenMirrorState {
screenMirrorState { running }
}screenMirrorVideoCodec
Nhận cập nhật cấu hình bộ mã hóa video của phiên phản chiếu màn hình.
subscription screenMirrorVideoCodec {
screenMirrorVideoCodec { annexB }
}screenMirrorAudioGranted
Nhận thông báo quyền âm thanh phản chiếu màn hình đã được cấp.
subscription screenMirrorAudioGranted {
screenMirrorAudioGranted
}openAccessibilitySettings
Mở màn hình cài đặt Trợ năng Android trên thiết bị. Cần thực hiện trước khi sendScreenMirrorControl có thể gửi cử chỉ.
mutation openAccessibilitySettings {
openAccessibilitySettings
}requestScreenMirrorAudio
Yêu cầu quyền micrô cho âm thanh phản chiếu màn hình. Trả về true nếu đã cấp, nếu không trả false (và mở hộp thoại quyền).
# Returns false when the device has not granted RECORD_AUDIO yet; the
# platform asks for it and the caller retries.
mutation requestScreenMirrorAudio {
requestScreenMirrorAudio
}requestScreenMirrorKeyFrame
Yêu cầu khung hình chính mới từ bộ mã hóa video phản chiếu màn hình đang hoạt động.
mutation requestScreenMirrorKeyFrame {
requestScreenMirrorKeyFrame
}startScreenMirror
Bắt đầu phiên phản chiếu màn hình. Truyền audio=true để truyền cả âm thanh thiết bị (yêu cầu quyền RECORD_AUDIO).
mutation startScreenMirror($audio: Boolean!) {
startScreenMirror(audio: $audio)
}stopScreenMirror
Dừng phiên phản chiếu màn hình đang hoạt động.
mutation stopScreenMirror {
stopScreenMirror
}updateScreenMirrorQuality
Đặt cấu hình chất lượng phản chiếu màn hình.
mutation updateScreenMirrorQuality($mode: ScreenMirrorMode!) {
updateScreenMirrorQuality(mode: $mode)
}isScreenMirroring
Kiểm tra phiên phản chiếu màn hình có đang hoạt động không.
query isScreenMirroring {
isScreenMirroring
}screenMirrorControlEnabled
Trả về true khi dịch vụ Trợ năng PlainApp được bật và có thể gửi cử chỉ.
query screenMirrorControlEnabled {
screenMirrorControlEnabled
}screenMirrorQuality
Lấy cấu hình chất lượng phản chiếu hiện tại.
query screenMirrorQuality {
screenMirrorQuality { mode resolution }
}screenMirrorVideoCodec
Lấy codec video dùng trong phiên phản chiếu hiện tại/cuối cùng.
# Null while the pipeline has not published its codec configuration.
query screenMirrorVideoCodec {
screenMirrorVideoCodec { annexB keyFrame }
}