# การเล่นวิดีโออัตโนมัติ (Autoplay)
ByteArk Player SDK for Flutter รองรับการเริ่มเล่นวิดีโออัตโนมัติเมื่อ Player พร้อมเล่น โดยกำหนดผ่าน autoPlay ของ ByteArkPlayerConfig
# การใช้งาน
final config = ByteArkPlayerConfig(
licenseKey: licenseKey,
playerItem: playerItem,
autoPlay: true,
);
1
2
3
4
5
2
3
4
5
| Property | Type | Default | Description |
|---|---|---|---|
autoPlay | bool? | true | เริ่มเล่นวิดีโออัตโนมัติเมื่อ Player พร้อม |
Note
ทั้ง iOS และ Android อาจจำกัดการเล่นอัตโนมัติพร้อมเสียงในบางสถานการณ์ (เช่น Low Power Mode บน iOS หรือยังไม่เคยมี User interaction บน Android) หากต้องการให้แน่ใจว่าวิดีโอเริ่มเล่นได้ พิจารณาเริ่มเล่นแบบปิดเสียงและให้ผู้ชมกดเปิดเสียงเอง