# ByteArk Lighthouse SDK สำหรับ ByteArk Player Flutter Plugin
ByteArk Player Flutter รองรับการเชื่อมต่อกับระบบ ByteArk Lighthouse เพื่อเก็บข้อมูลสถิติการรับชมวิดีโอจากทางฝั่ง Client-side ซึ่งจะทำให้ได้ข้อมูลสถิติ และ พฤติกรรมการดูวิดีโอที่ละเอียดขึ้น
byteark_player_flutter
มี ByteArk Lighthouse SDK รวมอยู่แล้ว คุณสามารถใช้งาน ByteArk Lighthouse ได้ทันทีหลังติดตั้ง ByteArk Player Flutter
# สถานะ
- ByteArk Player Flutter Plugin เวอร์ชั่น 1.1.5 เป็นต้นไป หรือเวอร์ชันล่าสุด
# ความเข้ากันได้
- ByteArk Lighthouse สำหรับ ByteArk Player Plugin Support Android(SDK 21+) และ iOS(14.0+)
# การใช้งาน Lighthouse ใน Player Item และ Player Config
# 1. สร้าง Player Item พร้อม Metadata
final _item = ByteArkPlayerItem(
url: "URL_วิดีโอของคุณ",
lighthouseMetaData: ByteArkPlayerLighthouseMetaData(
// ข้อมูลผู้ใช้ (เลือกส่งเฉพาะที่มี)
userId: 'user123',
age: 25,
country: 'Thailand',
// ข้อมูลวิดีโอ (เลือกส่งเฉพาะที่มี)
videoTitle: 'ชื่อวิดีโอ',
duration: 3600,
genres: ['หนัง', 'แอคชั่น'],
// ข้อมูลเพิ่มเติม (เลือกส่งเฉพาะที่มี)
d1: 'ข้อมูลเพิ่มเติม 1',
d2: 'ข้อมูลเพิ่มเติม 2'
),
);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 2. ตั้งค่า Lighthouse
final _config = ByteArkPlayerConfig(
playerItem: _item,
lighthouseSetting: ByteArkLighthouseSetting(
projectId: 'YOUR_PROJECT_ID', // ต้องระบุให้ถูกต้อง
debug: true // เปิดโหมด debug
),
);
1
2
3
4
5
6
7
2
3
4
5
6
7
# 3. ข้อควรระวัง
projectId
ต้องถูกต้อง มิฉะนั้น Lighthouse จะไม่ทำงาน- ข้อมูล Metadata เป็นตัวเลือก ส่งเฉพาะที่มีได้
- เปิด
debug: true
ในช่วงพัฒนา - ส่งข้อมูลที่ถูกต้องเพื่อการวิเคราะห์ที่มีประสิทธิภาพ
# 4. การตรวจสอบ
- ดู log ในคอนโซลเมื่อเปิด
debug: true
- ตรวจสอบข้อมูลใน ByteArk Dashboard
# รายละเอียด Metadata Fields
# ByteArkLighthouseSetting
Property | Type | คำอธิบาย |
---|---|---|
projectId | String | จำเป็น: รหัสเฉพาะของโปรเจค Lighthouse |
debug | bool? | ไม่บังคับ: เปิดโหมด debug (ค่าเริ่มต้นคือ false) |
# ByteArkPlayerLighthouseMetaData
Field | คำอธิบาย |
---|---|
userId | รหัสผู้ใช้ |
age | อายุ |
country | ประเทศ |
city | เมือง/จังหวัด |
lat | ละติจูด |
long | ลองจิจูด |
gender | เพศ |
nationality | สัญชาติ |
subscriptionPlan | แผนการสมัครสมาชิก |
accountCreationDate | วันที่สร้างบัญชี |
videoTitle | ชื่อวิดีโอ |
seriesId | รหัสซีรีส์ |
seriesTitle | ชื่อซีรีส์ |
season | ซีซัน |
episode | ตอน |
subEpisode | ตอนย่อย |
duration | ความยาววิดีโอ |
publishedDate | วันที่เผยแพร่ |
genres | ประเภทวิดีโอ |
rating | คะแนน |
d1 ถึง d10 | ข้อมูลเพิ่มเติมที่กำหนดเอง |