{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/vi/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Phát trực tiếp trên Cloud Phone"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"phát-trực-tiếp-trên-cloud-phone","__idx":0},"children":["Phát trực tiếp trên Cloud Phone"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sử dụng API mở hoặc API cục bộ để tải lên một tệp MP4, bắt đầu phát, kiểm tra trạng thái và dừng phát."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"điều-kiện","__idx":1},"children":["Điều kiện"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Dùng mẫu máy Tương thích; mẫu thiết bị khác hiện trả về ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["33401"]},". Bật Cloud Phone và lấy mã OAuth2 có quyền thao tác."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Tệp phải là MP4 và được tải lên với ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["uploadType=2"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"quy-trình-api-mở","__idx":2},"children":["Quy trình API mở"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Gọi ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/uploadUrl"]},", rồi tải MP4 lên ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["presignedUrl"]}," bằng HTTP ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Gọi ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/uploadFile"]}," với ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["uploadType: 2"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Kiểm tra ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/uploadFileResult"]},". Nếu ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}," là ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},", hãy tiếp tục thăm dò; dừng khi ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.status"]}," là ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," (thành công) hoặc ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2"]}," (thất bại)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Gửi chính xác giá trị chuỗi ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.fileId"]}," dưới dạng ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["int64"]}," tới ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/live/start"]},". Với JavaScript, dùng bộ tuần tự hóa hỗ trợ số nguyên chính xác tùy ý và không chuyển qua ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Number"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Dùng ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/cloudphone/live/status"]}," để kiểm tra và ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/cloudphone/live/end"]}," để dừng."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Với API cục bộ, dùng ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/cloudphone/upload/file/signedUrl"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/cloudphone/upload/file"]}," với ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["uploadType: 2"]}," và ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/cloudphone/upload/file/result"]},", sau đó gọi ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/cloudphone/live/start"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/status"]}," hoặc ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/end"]},". Số dư và hạn mức có tại ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /api/balance"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Xem ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/vi/api-reference/cloud-phone/open-api"},"children":["API mở"]}," và ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/vi/api-reference/cloud-phone/local-api"},"children":["API cục bộ Cloud Phone"]}," để biết đầy đủ lược đồ. Nếu yêu cầu bắt đầu hết thời gian, hãy kiểm tra trạng thái trước khi thử lại. Lỗi phát trực tiếp gồm ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["33300"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["33301"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["33401"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["33418"]}," và ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["99002"]},"; API tải lên trả về ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["33419"]}," cho tệp không phải MP4."]}]},"headings":[{"value":"Phát trực tiếp trên Cloud Phone","id":"phát-trực-tiếp-trên-cloud-phone","depth":1},{"value":"Điều kiện","id":"điều-kiện","depth":2},{"value":"Quy trình API mở","id":"quy-trình-api-mở","depth":2}],"frontmatter":{"seo":{"title":"Phát trực tiếp trên Cloud Phone"}},"lastModified":"2026-09-10T13:09:25.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/vi/api-reference/cloud-phone/live-streaming","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}