ชุดทดสอบ SDK สำหรับเล่นเกม
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ไปที่ชุดทดสอบ SDK
เมื่อเกมแสดงบน YouTube เกมจะมีส่วนหัวการตอบกลับ Content Security Policy เพื่อเพิ่มความปลอดภัยอีกชั้น
ซึ่งจะจํากัดประเภทแหล่งที่มาที่ฟีเจอร์เล่นเกมใช้ได้และประเภทคําขอเครือข่ายที่ฟีเจอร์เล่นเกมส่งได้ หากต้องการลดปัญหาเกี่ยวกับการรับรองและปรับปรุงกระบวนการผสานรวม ให้ลบล้างส่วนหัวของคำตอบ HTTP สำหรับไฟล์ index.html
เมื่อทดสอบในเครื่องเพื่อตรวจหาการละเมิด CSP ให้ได้เร็วที่สุด
คุณทําตามบทความนี้เพื่อตั้งค่าการลบล้างในเครื่องใน Chrome ได้
เมื่อตั้งค่าการลบล้างสำหรับเกมที่แสดงในเครื่องแล้ว ให้ใช้สตริงต่อไปนี้เพื่อลบล้างส่วนหัว Content-Security-Policy
default-src 'none'; script-src 'report-sample' 'self' 'unsafe-eval' 'unsafe-inline' blob: https://www.youtube.com/game_api/v0 https://www.youtube.com/game_api/v0/ https://www.youtube.com/game_api/v1 https://www.youtube.com/game_api/v1/; object-src 'none'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' blob: data:; media-src 'self' blob:; font-src 'self' data: https://fonts.googleapis.com https://fonts.gstatic.com; connect-src 'self' blob: data:; sandbox allow-pointer-lock allow-same-origin allow-scripts; base-uri 'self'; manifest-src 'self'; worker-src 'self' blob:
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-29 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-29 UTC"],[],["Testing Playables on YouTube involves managing the Content Security Policy (CSP) header, which restricts resource access and network requests for security. To avoid certification issues, locally override the HTTP response headers. Use Chrome's local override feature, referencing the provided article for setup. Apply the given `Content-Security-Policy` string to the header to test your locally served game. This allows for early detection of CSP violations during the integration process.\n"]]