camera.getLivePreview
Trả về luồng video liên tục với độ phân giải được chỉ định bằng
previewFormat
trong mục Tuỳ chọn.
Lệnh này sẽ trả về "Content-Type: multipart/x-mixed-replace; boundary="---osclivepreview---"".
Lệnh này đã được thêm vào từ API cấp 2.
Tham số
- Lệnh này không có tham số trong nội dung yêu cầu.
Kết quả
- Luồng video liên tục với các khung được phân tách bằng dấu phân cách ranh giới.
Lỗi
- disabledCommand: Lệnh hiện đang tắt;
ví dụ: máy ảnh đang quay video.
- không hợp lệ Tham số: Tên của tham số đầu vào là
không nhận dạng được.
Lệnh I/O |
Nhập lệnh |
none |
Kết quả lệnh |
Continuous video stream. |
Ra lệnh (Lỗi) |
{ "error": { "code": "disabledCommand", "message": "Command is currently disabled." } } |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-08-21 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-08-21 UTC."],[[["Initiates a continuous video stream with the resolution set in previewFormat."],["Returns a multipart video stream separated by boundary \"---osclivepreview---\"."],["This command is only available for API level 2 and above."],["Potential errors include disabledCommand if the camera is busy and invalidParameterName for incorrect input."]]],["The command initiates a continuous video stream at the resolution defined by `previewFormat`. The stream is a multipart/x-mixed-replace type, using \"---osclivepreview---\" as a boundary separator. It accepts no parameters. The output is a continuous video stream with frames separated by the boundary. Errors include \"disabledCommand\" (e.g., when the camera is recording) and \"invalidParameterName\". This command was introduced in API level 2.\n"]]