คลาส GCKCastOptions
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตัวเลือกที่ส่งผลต่อการค้นพบอุปกรณ์แคสต์และการทำงานของเซสชันแคสต์
ต้องตั้งค่าคุณสมบัติที่เขียนได้ก่อนส่งออบเจ็กต์นี้ไปยัง GCKCastContext
- Since
- 3.0
รับค่า NSObject, <NSCopying> และ <NSSecureCoding>
สร้างออบเจ็กต์ GCKCastOptions ใหม่ที่มีเกณฑ์การค้นพบที่ระบุ
- Parameters
-
discoveryCriteria | The discovery criteria to apply to discovered Cast devices. Only those devices that satisfy the criteria will be made available to the application. |
- Since
- 4.0
- (instancetype) initWithReceiverApplicationID: |
|
(NSString *) |
applicationID |
|
สร้างออบเจ็กต์ GCKCastOptions ใหม่ที่มีรหัสแอปพลิเคชันของผู้รับที่ระบุ
- Parameters
-
applicationID | The ID of the receiver application which must be supported by discovered Cast devices, and which will be launched when starting a new Cast session. |
- Deprecated:
- ใช้ initWithDiscoveryCriteria
- (instancetype) initWithSupportedNamespaces: |
|
(NSArray< NSString * > *) |
namespaces |
|
สร้างออบเจ็กต์ GCKCastOptions ใหม่ด้วยรายการเนมสเปซที่ระบุ
- Parameters
-
namespaces | A list of namespaces which must be supported by the currently running receiver application on each discovered Cast device. |
- Deprecated:
- ใช้ initWithDiscoveryCriteria
- (BOOL) physicalVolumeButtonsWillControlDeviceVolume |
|
readwritenonatomicassign |
ธงระบุว่าปุ่มปรับระดับเสียงของอุปกรณ์ผู้ส่งควรควบคุมระดับเสียงของเซสชันหรือไม่
- (BOOL) disableDiscoveryAutostart |
|
readwritenonatomicassign |
- (BOOL) disableAnalyticsLogging |
|
readwritenonatomicassign |
แฟล็กที่ใช้ในการปิดหรือเปิดใช้การเก็บรวบรวมข้อมูลการวินิจฉัยเพื่อปรับปรุงความน่าเชื่อถือของการค้นพบอุปกรณ์แคสต์
ค่าเริ่มต้นคือ NO
(เปิดใช้) ซึ่งอาจปิดใช้โดยการตั้งค่าเป็น YES
- Since
- 4.0
ตัวเลือกการเปิดเครื่องรับที่จะใช้เมื่อเริ่มเซสชันการแคสต์
- (NSString*) sharedContainerIdentifier |
|
readwritenonatomiccopy |
ตัวระบุคอนเทนเนอร์ที่แชร์ซึ่งใช้สำหรับการดาวน์โหลด HTTP ในเบื้องหลังซึ่งดำเนินการโดยเฟรมเวิร์ก
- Since
- 3.2
- (BOOL) suspendSessionsWhenBackgrounded |
|
readwritenonatomicassign |
ควรระงับเซสชันเมื่อแอปพลิเคชันของผู้ส่งทำงานในเบื้องหลังหรือไม่ (และกลับมาทำงานอีกครั้งเมื่อกลับไปที่เบื้องหน้า)
โดยค่าเริ่มต้น ตัวเลือกนี้จะกำหนดเป็น YES
ควรตั้งค่านี้เป็น NO
ในแอปพลิเคชันที่รักษาการเชื่อมต่อเครือข่ายได้ตลอดไปอย่างไม่มีกำหนดขณะทำงานอยู่เบื้องหลัง
- Since
- 3.4
- (BOOL) stopReceiverApplicationWhenEndingSession |
|
readwritenonatomicassign |
ควรยุติแอปพลิเคชันเครื่องรับเมื่อผู้ใช้ปิดเซสชันผ่านปุ่ม "หยุดแคสต์" หรือไม่
โดยค่าเริ่มต้น ตัวเลือกนี้จะกำหนดเป็น NO
- Since
- 4.0
- (BOOL) startDiscoveryAfterFirstTapOnCastButton |
|
readwritenonatomicassign |
กำหนดว่าการค้นหาอุปกรณ์แคสต์จะเริ่มต้นหลังจากที่ผู้ใช้แตะ GCKUICastButton
ครั้งแรกเท่านั้นหรือไม่
หากตั้งค่าเป็น YES
ระบบจะแสดง GCKUICastButton
จนกว่าผู้ใช้จะแตะปุ่ม "แคสต์" เป็นครั้งแรก ในการแตะครั้งแรก ระบบจะแสดงโฆษณาคั่นระหว่างหน้าเพื่ออธิบายเหตุผลที่จำเป็นต้องมีสิทธิ์การเข้าถึงเครือข่าย LAN เพื่อให้การแคสต์ทำงานได้ การค้นพบจะเริ่มต้นขึ้นเมื่อปิดโฆษณาคั่นระหว่างหน้า ปุ่ม "แคสต์" จะแสดงอีกครั้งเมื่ออุปกรณ์เชื่อมต่อกับเครือข่าย Wi-Fi เท่านั้น เมื่อไม่ได้เชื่อมต่อเครือข่าย Wi-Fi ปุ่ม "แคสต์" จะซ่อนไป หากตั้งค่าเป็น NO
การค้นพบจะเริ่มต้นตามแฟล็ก disableDiscoveryAutoStart
การตั้งค่าสถานะนี้จะมีผลเฉพาะใน iOS 14 ขึ้นไปเท่านั้น หากตั้งค่าแฟล็ก disableDiscoveryAutoStart
เป็น NO
ค่าเริ่มต้นคือ YES
- Since
- 4.5.3
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2023-12-02 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"]],["อัปเดตล่าสุด 2023-12-02 UTC"],[[["GCKCastOptions manages the discovery of Cast devices and Cast session behavior, with writable properties needing configuration before use."],["It offers various options, including controlling session volume with device buttons, managing discovery timing, and handling session suspension and receiver application termination."],["Developers can specify discovery criteria, receiver application ID, and supported namespaces to refine the Cast device selection process."],["GCKCastOptions also allows customization of launch options, background downloads, and the behavior of the Cast button on iOS 14 and above."],["It's worth noting that some initialization methods using receiver application ID or supported namespaces are deprecated in favor of using discovery criteria for more flexibility."]]],["The GCKCastOptions class configures Cast device discovery and session behavior. Key actions include: constructing options with discovery criteria, receiver application ID, or namespaces; setting flags to control session volume with physical buttons, manage discovery autostart, enable/disable diagnostic data collection, and suspend sessions when backgrounded. It also specifies receiver launch options, shared container identifiers, terminating the receiver app on session end, and initiating device discovery on the first Cast button tap. These writable properties must be configured prior to use.\n"]]